📄 统计字符(82.2).txt
字号:
#include<stdio.h>
void main()
{
char c;
int ying=0,space=0,shu=0,others=0;
printf("请输入一行字符:");
while((c=getchar())!= '\n')
{
if(c>='a' && c<='z' || c>='A' && c<='Z')
ying++;
else if(c==' ') //''表空格。
space++;
else if(c>='0' && c<='9')
shu++;
else
others++;
}
printf("经过统计为:ying=%d space=%d shu=%d others=%d\n",ying,space,shu,others);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -