#include<stdio.h>
int main(){ int digit, other, blank; char ch; digit=0,blank=0,other=0; //首先定义计数变量并初始化 while((ch=getchar())!=’\n’) { //当输入不等于回车时循环 //根据各种情况用if语句判断来设置变量的值 if(ch>=‘0’&&ch<=‘9’) digit++; else if(ch==’ ') blank++; else other++; } //最后按照题目给出的格式进行打印输出 printf(“blank = %d, digit = %d, other = %d\n”,blank,digit,other); return 0;}
01-18
1856
02-22
6407
10-28
10-04