Educational Codeforces Round 26;A. Text Volume
来源:互联网 发布:工资考勤软件 验厂 编辑:程序博客网 时间:2024/06/08 08:06
题目: A. Text VolumeYou 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.
InputThe first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
OutputPrint one integer number — volume of text.
ExamplesInput7NonZERO
Output5
Input24this is zero answer text
Output0
Input24Harbour Space University
Output1
NoteIn 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.
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.
The first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
Print one integer number — volume of text.
7NonZERO
5
24this is zero answer text
0
24Harbour Space University
1
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.
题意:求给定文本的容量。每个文本的容量为各个单词容量的最大值,每个单词的容量为单词中大写字母的个数
CODE:
#include<bits/stdc++.h>using namespace std;int main(){ int n,i,cnt; char ch; while(~scanf("%d%*c",&n)){ int maxr=-1; cnt=0; for(i=0;i<n;i++){ scanf("%c",&ch); if(ch==' '){ maxr=max(maxr,cnt); cnt=0; } else if(ch>='A'&&ch<='Z') cnt++; } getchar(); maxr=max(maxr,cnt); printf("%d\n",maxr); } return 0;}
- Educational Codeforces Round 26;A. Text Volume
- Educational Codeforces Round 26 A. Text Volume
- Educational Codeforces Round 4 A. The Text Splitting
- Educational Codeforces Round 26 A—C
- codeforces 837A Text Volume
- codeforces 837A Text Volume
- Codeforces 837A Text Volume
- Educational Codeforces Round 5 A
- Educational Codeforces Round 20 A
- Educational Codeforces Round 21 A
- Educational Codeforces Round 23 A
- Educational Codeforces Round 26
- Educational Codeforces Round 26
- codeforces Educational Codeforces Round 21 A
- Educational Codeforces Round 26 A B C 三道水题
- Educational Codeforces Round 26总结
- Educational Codeforces Round 26 B
- Educational Codeforces Round 26 C
- 电商运营的十招,你会几招?
- centos下安装使用SVN
- hdu6069 Counting Divisors(质数分解+技巧)
- 百度搜索高级语法技巧
- uva-572 种子填充floodfill
- Educational Codeforces Round 26;A. Text Volume
- 整数算法训练03—输入5个数(含负数、小数)将它们按由小到大的顺序排列起来
- Timer定时器
- hbase分布式集群安装
- 字符串训练——求字符串长度、去掉空格
- 使用动画绘制飘动的云朵
- HTML&CSS基础篇之十:CSS基础
- HTML中meta标签的作用与使用
- C# Foreach循环本质与枚举器