⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 统计字符(82.2).txt

📁 c程序
💻 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 + -