codeforces 837A Text Volume
2017-08-09 11:50
1461 查看
点击打开链接
A. Text Volume
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of
all words in the text.
Calculate the volume of the given text.
Input
The first line contains one integer number n (1 ≤ n ≤ 200)
— length of the text.
The second line contains t
4000ext of single-space separated words s1, s2, ..., si,
consisting only of small and capital Latin letters.
Output
Print one integer number — volume of text.
Examples
input
output
input
output
input
output
Note
In the first example there is only one word, there are 5 capital letters in it.
In the second example all of the words contain 0 capital letters.
水题
A. Text Volume
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of
all words in the text.
Calculate the volume of the given text.
Input
The first line contains one integer number n (1 ≤ n ≤ 200)
— length of the text.
The second line contains t
4000ext of single-space separated words s1, s2, ..., si,
consisting only of small and capital Latin letters.
Output
Print one integer number — volume of text.
Examples
input
7 NonZERO
output
5
input
24 this is zero answer text
output
0
input
24 Harbour Space University
output
1
Note
In the first example there is only one word, there are 5 capital letters in it.
In the second example all of the words contain 0 capital letters.
水题
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main() { char s[200]; int m=0,x,n; scanf("%d",&n); while(~scanf("%s",s)) { x=0; int len=strlen(s); for(int i=0;i<len;i++) { if(s[i]>='A'&&s[i]<='Z') x++; } m=max(m,x); } printf("%d\n",m); return 0; }
相关文章推荐
- Codeforces 313
- CodeForces 547C. Mike and Foam 莫比乌斯反演
- codeforces——492A——Vanya and Cubes
- Codeforces 155D Colliders【思维+模拟】
- 【CodeForces】223A - Bracket Sequence(栈 & 模拟)
- Codeforces(738D)-D. Sea Battle
- Codeforces 314A. Sereja and Contest
- Codeforces 336C Vasily the Bear and Sequence (暴力)
- Codeforces 811B Vladik and Complicated Book
- CodeForces - 873B Balanced Substring
- CODEFORCES 270B Multithreading <<新闻持续更新>>
- codeforces 740B Alyona and flowers
- ural 1091. Tmutarakan Exams 和 codeforces 295 B. Greg and Graph
- CodeForces 490E Restoring Increasing Sequence(贪心)
- CodeForces 652C Foe Pairs(思维)
- Codeforces734E【缩点+树的直径】
- CodeForces 518B Tanya and Postcard
- Codeforces 61B【怪在读题】
- codeforces 327 B. Hungry Sequence
- Codeforces 461B Appleman and Tree