44问答网
所有问题
输入一行字符,分别统计出其中空格的个数。用C语言编程,不能用数组
如题所述
举报该问题
推荐答案 2016-01-03
//#include "stdafx.h"//If the vc++6.0, with this line.
#include "stdio.h"
int main(void){
int n=0,ch;
while((ch=getchar())!='\n')
if(ch==' ')
n++;
printf("In this lin, a total of %d Spaces.\n",n);
return 0;
}
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/vevB7BvetOvOjjBvOe.html
相似回答
大家正在搜