职业资格>计算机等级 > 二级C语言程序设计
二级C语言程序设计 - 相关题库
单选题 编号:2482939
1.若有定义:
char s[30] = {0};
运行时输入:
This is a string.<回车>
则以下不能正确读入整个字符串:
This is a string.
到字符数组 s 中的语句组是(  )。
  • A.scanf("%s",s);
  • B.gets(s);
  • C.for(i=0;(c=getchar())!=' ';i++)s[i]=c;
  • D.i=0;while((c=getchar())!=' ')s[i++]=c;

选择购买的题库