hdu 2030
来源:互联网 发布:webshell密码暴力破解 编辑:程序博客网 时间:2024/05/21 10:07
汉字统计
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23975 Accepted Submission(s): 13081
Problem Description
统计给定文本文件中汉字的个数。
Input
输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。
Output
对于每一段文本,输出其中的汉字的个数,每个测试实例的输出占一行。
[Hint:]从汉字机内码的特点考虑~
[Hint:]从汉字机内码的特点考虑~
Sample Input
2WaHaHa! WaHaHa! 今年过节不说话要说只说普通话WaHaHa! WaHaHa!马上就要期末考试了Are you ready?
Sample Output
149
//@auther Yang Zongjun#include <iostream>#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#include <string>using namespace std;#define PI acos(-1.0)#define EPS 1e-8const int MAXN = 1100000;const int INF = 2100000000;char c[205];int main(){ //freopen("C:/Users/Administrator/Desktop/input.txt", "r", stdin); int n; scanf("%d", &n); getchar(); while(n--) { gets(c); int len = strlen(c); int ans = 0; for(int i = 0; i< len; i++) { if(c[i] < 0) { ans++; } } printf("%d\n", ans / 2); } return 0;}
0 0
- hdu 2030
- HDU-2030
- HDU 2030
- hdu 2030
- HDU--2030
- HDU 2030
- HDU 2030 汉字统计
- hdu 2030 汉字统计
- hdu 2030 汉字统计
- hdu 2030 汉字统计
- HDU 2030 汉字统计
- HDU 2030 - 汉字统计
- hdu oj 2030
- hdu-2030判断汉字
- [hdu 2030] 汉字统计
- HDU 2030 汉字统计
- hdu-2030-汉字统计
- HDU 2030 汉字统计
- 两个栈实现队列 && 两个队列实现栈
- 阿里巴巴2015年秋季在线笔试附加题---求交集字符串
- Codeforces 464A. No to Palindromes! (dp,向前推理,向后查询)
- 编译原理实验之源程序的预处理及词法分析程序设计
- 2014年暑假总结
- hdu 2030
- 正则基础之——贪婪与非贪婪模式
- 例题7-7 天平难题 UVa1354
- Codeforces 464B. Restore Cube (一种高效八点判断立方体(cube)的办法)
- iOS UI核心
- RocketMQ原理解析-producer 2.如何发送消息
- cocos2d-x 3.2 |飞机大战:敌机与爆炸
- 今天查资料的时候 看到的一句话 ~~~
- 分类方法