有以下程序段 char st[20]="hello\0\t\\";printf("%d%d\n",strlen(st),sizeof(st)); 输出结果是( )。
A. 9 9
B. 5 20
C. 13 20
D. 20 20
查看答案
程序段 char s[ ]=”\tstring\n”; printf(“%d”,strlen(s));的运行结果是( )。
A. 8
B. 9
C. 10
D. 11
以下程序的运行结果是______ #include #include using namespace std;int main(){ char *p1, *p2, str[50]="ABCDEFG"; p1="abcd"; p2="efgh"; strcpy(str+2, p1+1); strcpy(str+3, p2+2); cout << str+1; return 0;}
以下程序的运行结果是______ #include using namespace std;int main(){ char c[ ]="the teacher"; int n=0; while(c[++n]!='\0') if (c[n-1]=='h') cout<
以下程序的运行结果是______ #include using namespace std;int main(){ int sum=0,n=0; while (1) { n=n+1; if (n>4) break; if (n%2) continue; sum+=n; } printf ("sum=%d n=%d\n",sum,n); return 0;}