嗯!如此统计文章字符类型和个数
来源:互联网 发布:怎样合理网络理财 编辑:程序博客网 时间:2024/04/30 06:08
#include <iostream>
using namespace std;
int main()
{int i,j=0,A=0,b=0,data=0,other=0,space=0;
char a[3][80];
for(i=0;i<3;i++)
{ cin>>a[i];
for(j=0;j<80,a[i][j]!='\0';j++)
{if(a[i][j]>='A'&&a[i][j]<='Z')
A++;
else if(a[i][j]>='a'&&a[i][j]<='z')
b++;
else if(a[i][j]>='0'&&a[i][j]<='9')
data++;
else if(a[i][j]=='')
space++;
else
other++;
}
}
cout<<"big char:"<<A<<endl;
cout<<"little char:"<<b<<endl;
cout<<"data:"<<data<<endl;
cout<<"space:"<<space<<endl;
cout<<"others:"<<other<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{int i,j=0,A=0,b=0,data=0,other=0,space=0;
char a[3][80];
for(i=0;i<3;i++)
{ gets(a[i]); //gets与cin有所不同
for(j=0;j<80,a[i][j]!='\0';j++)
{if(a[i][j]>='A'&&a[i][j]<='Z')
A++;
else if(a[i][j]>='a'&&a[i][j]<='z')
b++;
else if(a[i][j]>='0'&&a[i][j]<='9')
data++;
else if(a[i][j]==' ')
space++;
else
other++;
}
}
cout<<"big char:"<<A<<endl;
cout<<"little char:"<<b<<endl;
cout<<"data:"<<data<<endl;
cout<<"space:"<<space<<endl;
cout<<"others:"<<other<<endl;
return 0;
- 嗯!如此统计文章字符类型和个数
- 统计string中的字符类型和个数
- 统计文章中英文字符个数!
- 统计一行字符的各种类型个数
- C# 统计文章中字符的种类和个数 哈希表和字典的使用
- acm-统计字符数组中各种类型字符的个数
- Java 统计字符个数和分离字符串
- python统计字符串中字符的类型个数
- 统计字符串中不同字符类型的个数
- 统计字符个数!!!
- 统计字符个数
- 统计字符个数
- 1050 字符个数统计
- 汇编 统计字符个数
- 字符个数统计
- 机试-字符个数统计
- 【oj1953】字符个数统计
- C#统计字符个数
- 制造业ERP系统核心功能
- tiny6410开发板linux系统下的SPI驱动和测试
- LinuxC/C++编程基础(28) “心跳”信息的处理
- 单选和复选框的小例子
- 一路走来,带着微笑,带着汗水
- 嗯!如此统计文章字符类型和个数
- recommendation system overview
- 设计模式9:装饰模式【结构型】
- jsp中获取当前页的url & response.sendRedirect(url)参数过长及乱码问题
- 需要求三个长方体的体积,请编写一个基于对象的程序。
- Linux 网络栈剖析: 从 socket 到设备驱动程序
- 求Fibnacci 序列的第 20 个数
- 最美的爱情
- 连接也有这么几个法