单项选择题

有以下程序
#include<stdio.h>
main()
char s[]="012xy\08s34f4w2";
int i,n=0;
for(i=0,s[i]!=0;i++)
if(s[i]>="0"&&s[i]<=’9’)n++;
printf("%d\n",n);

程序运行后的输出结果是______。

A.3
B.0
C.7
D.8
<上一题 目录 下一题>
热门 试题

单项选择题
以下叙述中正确的是______。
A.对于字符串常量"string!",系统已自动在最后加入了’\0’字符,表示串结尾
B.语句char str[10]="string!";和char str[10]="string!";并不等价
C.对于一维字符数组,不能使用字符串常量来赋初值
D.在语句char str[]="string!";中,数组str的大小等于字符串的长度
单项选择题
设有定义: char s[81];int i=0; 以下不能将一行(不超过80个字符)带有空格的字符串正确读入的语句或语句组是______。
A.scanf("%s",s);
B.while((s[i++]=getchar())!=’\n’);s[i]=’\0’;
C.gets(s);
D.doscanf("%c",&s[i]);while(s[i++]!=’\n’);s[i]=’\0’;
相关试题
  • 有以下程序 #include<stdio.h> #inc...
  • 若有定义语句: char s[10]= 12...
  • 若有定义语句: char*s1= OK ,*s2...
  • 若有以下定义和语句 #include<stdio.h...
  • 有以下程序 #include<stdio.h> char...