有以下程序: #include(stdio.h> main( ) {char a,b,C,d; scanf("%c%C",&a,&b); c=getchar( );d=getchar( ); printf{"%c%c%c%c\n",a,b,C,d); } 当执行程序时,按下列方式输入数据(从第l列开始,<CR>代表回车j注意:回车也是 一个字符) 12<CR> 34<CR> 则输出结果是( )。
A.1234
B.12
C.12 3
D.12 34
第1题:
有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是
A.def def
B.abc def
C.abc d
D.d d
第2题:
有以下程序: #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是( )。
A.def def
B.abc def
C.abe d
D.d d
第3题:
有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是
A.def def
B.abc def
C.abc d
D.d d
第4题:
有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是
A.def def
B.abc del
C.abc d
D.d d
第5题:
有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是
A.12
B.15
C.6
D.5
第6题:
有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。
A.2
B.3
C.4
D.5