有以下程序
#include <stdio.h>
main()
{ char a[20]="How are you?",b[20];
scanf("%s",b); printf("%s %s\n",a,b);
}
程序运行时从键盘输入: How are you?< 回车 >
则输出结果为 【 1 3 】 。
第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题:
以下正确的程序段是
A.cgar str[20]; scanf("%s",&str);
B.char*p; scanf("%s",p);
C.char str[20]; scanf("%s",&str[2])
D.char str[20],*p=str; scanf("%s",p[2]);
第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 <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
第6题:
以下正确的程序段是
A.cgar str[20]; scanf("%s",&str);
B.char *p; scanf("%s",p);
C.char str[20]; scanf("%s",&str[2])
D.char str[20],*p=str; scanf("%s",p[2]);