【单选题】若有定义: char s[30] = {0}; 运行时输入: This is a string. 则以下不能正确读入整个字符串: This is a string. 到字符数组 s 中的语句组是 ______ 。
C.
for (i=0; (c=getchar()) != '\n'; i++) s[i] = c;
D.
i = 0; while ((c=getchar())!='\n') s[i++] = c;
【简答题】若有定义:char s[30] = {0};运行时输入:This is a string.则以下能正确读入整个字符串:This is a string. 到字符数组 s 中的语句组是( )A. i = 0;while ((c=getchar())!='\n') s[i++] = c; B. gets(s); C. for (i=0; (c=getchar()) != '\n'; i++) s[i...
【单选题】若有定义: char s[30] = {0}; 运行时输入: This is a string. 则以下不能正确读入整个字符串: This is a string. 到字符数组 s 中的语句组是
A.
i = 0;while ((c=getchar())!='\n') s[i++] = c;
C.
for (i=0; (c=getchar()) != '\n'; i++) s[i] = c;
【单选题】若有定义: char s[30] = {0}; 运行时输入: This is a string. 则以下不能正确读入上述字符串到字符数组 s 中的选项是
B.
for (i=0; (c=getchar()) != '\n'; i++) s[i] = c;
D.
i = 0; while ((c=getchar())!='\n') s[i++] = c;
【简答题】若有定义语句:char *s1="OK", *s2="ok";以下选项中,能够输出"OK"的语句是A. if (strcmp(s1,s2)!=0) puts(s2); B. if (strcmp(s1,s2)!=0) puts(s1); C. if (strcmp(s1,s2)==1) puts(s1); D. if ( strcmp(s1,s2)==0) puts(s1);
【单选题】.若有定义:char s[30] = {0};运行时输入:This is a string.,则以下不能正确读入整个字符串:This is a string. 到字符数组 s 中的语句组是
A.
i = 0;while ((c=getchar())!='\n') s[i++] = c;
C.
for (i=0; (c=getchar()) != '\n'; i++) s[i] = c;
【单选题】试题30 若有定义语句: char *s1=”OK”, *s2=”ok” , 以下选项中,能够输出”OK”的语句是()
A.
if(strcmp(s1,s2)==0) puts(s1)
B.
if(strcmp(s1,s2)!=0) puts(s2)
C.
if(strcmp(s1,s2)==1) puts(s1)
D.
if(strcmp(s1,s2)!=0) puts(s1)