ural 1038 Spell Checker
2011-02-07 10:53
351 查看
我最讨厌字符串处理的题了......
]#include<iostream> using namespace std; int tot; bool over=true; bool cap(char c) { if(c>='A'&&c<='Z') return true; else return false; } bool letter(char c) { if(c>='A'&&c<='Z'||c>='a'&&c<='z') return true; return false; } int main() { int i,j,k; char c; // freopen("u1038.in","r",stdin); // freopen("u1038.out","w",stdout); while((c=getchar())!=EOF) { if(c=='.'||c=='!'||c=='?') { over=true; continue; } if(!letter(c)) continue; if(over&&!cap(c)) tot++; over=false; c=getchar(); while(letter(c)) { if(cap(c)) tot++; c=getchar(); } if(c=='.'||c=='!'||c=='?') over=true; } printf("%d/n",tot); return 0; }
相关文章推荐
- ural 1038. Spell Checker
- URAL 1038 Spell Checker
- URAL 1038 Spell Checker
- Ural1094 && Ural1038(简单字符串)
- URAL 1647 Divide an Island!
- Ural1033 FloodFill 算法
- URAL 1513. Lemon Tale(简单的递推)
- ural 1260. Nudnik Photographer(dp)
- Ural 1183 Brackets Sequence(区间DP+记忆化搜索)
- ural 1057 Amount of degrees 【数位dp】
- URAL 1748. The Most Complex Number(反素数)
- URAL 1348. Goat in the Garden 2[求点到线段的距离]
- CEOI 2002, POJ 1038 Bugs Integrated, Inc. 状态压缩 DP
- 【URAL】1297 Palindrome 【后缀数组+RMQ——求最长回文子串】
- ural 1119 Metro dp水
- URAL 1146. Maximum Sum
- 【链表】URAL 1579 Coat Transportation
- 后缀数组(最长回文子串)——ural 1297
- URAL 1521 War Games 2 树状数组解决约瑟夫环,输出离队顺序
- URAL 1203 Scientific Conference 简单dp 难度:0