(c=getchar())为什么不能用scanf("%C",&C)或(c=scanf("%C",&C))
#include"stdio.h"void main()
{
int zongshu=0,zimushu=0,shuzishu=0,kongge=0;
char c;
while((c=getchar())!='\n')
{
zongshu+=1;
if(c>='0'&&c<='9')
{
shuzishu+=1;
}
if(c>='A'&&c<'Z'||c>='a'&&c<='z')
{
zimushu+=1;
}
if(c==' ')
{
kongge+=1;
}
}
printf("总数=%d\n数字数=%d\n字母数=%d\n空格数=%d\n",zongshu,shuzishu,zimushu,kongge);
}
以上程序当中的 (c=getchar())为什么不能用scanf("%C",&C)或(c=scanf("%C",&C))来代替,程序不能正常运行?