Text Volume
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 text 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.
AC代码(有部分参考别的博主的代码)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char s[200];
int main()
{
int n,x,m = 0;
scanf("%d",&n);
while(~scanf("%s",s)){//输入不为空格时进行循环 注意这种写法
x = 0;
int len = strlen(s);//每次的len代表了一个单词的长度
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;
}
上一篇: hdu1811 并查集+拓扑排序
下一篇: 精选枚举代替开关
推荐阅读
-
对text数据类型不支持代码页转换 从: 1252 到: 936
-
20 个强大的 Sublime Text 插件
-
CSS里的text-indent怎么使用
-
『MySQL』索引类型 normal, unique, full text
-
分析PHP的similar_text函数_PHP教程
-
mysql中blob和text有什么区别
-
text utf8_bin 出现 [Blob - XXX bytes] 该怎么解开?
-
sublime text2编辑器里面的ConvertToUTF8插件具体如何使用??
-
Flutter Text文本删除线、下划线设置
-
4.1 段落样式概述 4.2 下划线、删除线和顶划线text-decoration