填空题
下列程序的功能:对输入的一行字符中的数字字符的字面值累加,输出此累加和,请填空。
#include<stdio.h>
#include<ctype.h>
main()
char c;
int a,s=0;
while(______)
if(isdigit(c))
a=c-’0’;s+=a;
printf("s=%d",s);
【参考答案】
(c=getchar())!=’\n’
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
函数fun的返回值是 。 fun(char *a,char *b) int num=0,n=0; while(*(a+num)!=’ 0’)num++; while(b[n]) *(a+num)=b[n];num++;n++; return num;
点击查看答案&解析
填空题
以下程序的输出结果是______。 #include<stdio.h> main() int n=12345,d; while(n!=0)d=n %10;printf( %d ,d);n =10;
点击查看答案&解析
相关试题
以下程序运行后的输出结果是 。 main()...
以下程序运行后的输出结果是______。...
下列程序的功能是对输入的一行字符中的数字...
下列程序的运行结果是______。 main...
以下程序的功能是:求出数组x中各相邻两个...