Educational Codeforces Round 26 Problem A
A. Text Volumetime limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard 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.
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.
Examplesinput7
NonZEROoutput5input24
this is zero answer textoutput0input24
Harbour Space Universityoutput1NoteIn 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.
题目大意:输出所给字符串中大写字符最多的数量
输入输出的入门题。
1 #include<iostream>
2 #include<stdio.h>
3 using namespace std;
4 int main(){
5 int n;
6 char a[300];
7 cin>>n;
8 char c;
9 c=getchar();
10 gets(a);
11 int mx=0;
12 for(int i=0;i<n;i++){
13 int tmp=0;
14 while(a[i]!=' '&&i<n){
15 if(a[i]>='A'&&a[i]<='Z'){
16 tmp++;
17 }
18 i++;
19 }
20 mx=max(mx,tmp);
21 }
22 cout<<mx<<endl;
23 return 0;
24 }
Educational Codeforces Round 26 Problem A的更多相关文章
- Educational Codeforces Round 26
Educational Codeforces Round 26 困到不行的场,等着中午显示器到了就可以美滋滋了 A. Text Volume time limit per test 1 second ...
- CodeForces 837F - Prefix Sums | Educational Codeforces Round 26
按tutorial打的我血崩,死活挂第四组- - 思路来自FXXL /* CodeForces 837F - Prefix Sums [ 二分,组合数 ] | Educational Codeforc ...
- CodeForces - 837E - Vasya's Function | Educational Codeforces Round 26
/* CodeForces - 837E - Vasya's Function [ 数论 ] | Educational Codeforces Round 26 题意: f(a, 0) = 0; f( ...
- CodeForces 837D - Round Subset | Educational Codeforces Round 26
/* CodeForces 837D - Round Subset [ DP ] | Educational Codeforces Round 26 题意: 选k个数相乘让末尾0最多 分析: 第i个数 ...
- Educational Codeforces Round 32 Problem 888C - K-Dominant Character
1) Link to the problem: http://codeforces.com/contest/888/problem/C 2) Description: You are given a ...
- Educational Codeforces Round 26 [ D. Round Subset ] [ E. Vasya's Function ] [ F. Prefix Sums ]
PROBLEM D - Round Subset 题 OvO http://codeforces.com/contest/837/problem/D 837D 解 DP, dp[i][j]代表已经选择 ...
- Educational Codeforces Round 26 B,C
B. Flag of Berland 链接:http://codeforces.com/contest/837/problem/B 思路:题目要求判断三个字母是否是条纹型的,而且宽和高相同,那么先求出 ...
- Educational Codeforces Round 21 Problem E(Codeforces 808E) - 动态规划 - 贪心
After several latest reforms many tourists are planning to visit Berland, and Berland people underst ...
- Educational Codeforces Round 21 Problem D(Codeforces 808D)
Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into t ...
- Educational Codeforces Round 21 Problem A - C
Problem A Lucky Year 题目传送门[here] 题目大意是说,只有一个数字非零的数是幸运的,给出一个数,求下一个幸运的数是多少. 这个幸运的数不是最高位的数字都是零,于是只跟最高位有 ...
随机推荐
- jmeter 二次开发详解
背景: JMeter 是一个功能强大的性能测试工具,但它可能无法满足特定项目或组织的特定需求.通过进行二次开发,可以定制 JMeter,使其适应具体项目的需求.例如,可能需要添加自定义的 测试元件.报 ...
- Python API接口对接详解与实践
在数字化时代,数据交互已经成为各种应用的必备功能.API(应用程序编程接口)就是实现不同应用程序之间数据交互的一种方式.Python作为一种功能强大的编程语言,也提供了许多用于对接API的库和框架 ...
- ELK环境部署-Filebeat数据收集(三)
一.安装JAVA环境 1.解压jdk压缩包 abc@elk:~$ sudo tar -zxvf jdk-11.0.18_linux-x64_bin.tar.gz -c jdk11 2.添加环境变量 a ...
- 避坑|在读取excel.xlsx文件中的内容时发现明明只有3行,但跑起来却认为有13行,导致有10行None,UI自动化测试代码空跑了10次;|UI自动化测试|数据驱动
在读取excel.xlsx文件中的内容时发现明明只有3行,但跑起来却认为有13行,导致有10行None,UI自动化测试代码空跑了10次: 原因:excel.xlsx内容清除时用delete快捷键导致, ...
- WorkPress使用BackWPup插件备份后手动还原方法记录
前提 拿到BackWPup插件备份的zip包(下文均以backup.zip来指代).这个是备份包是事先从源WorkPress上备份好的. 环境 OS:Centos7.9 Apache:2.4.6 PH ...
- UM 百度富文本编辑器自定义图片上传路径
UM 百度富文本编辑器自定义图片上传路径 因为公司要做图文编辑,选择了UM,但是直接存入Tomcat根目录下,不满足业务需求需要存入服务器上. 一.需要注意的是在um的JSP目录下已经存在了Uploa ...
- MPI转以太网Plus模块Modbus连接两台变频器通信案例
MPI转以太网Plus模块Modbus主站连接两台变频器通信案例 MPI转以太网Plus模块连接200PLC无需编程实现Modbus主从站功能与2台变频器modbus通信:以下就是MPI转以太网模块作 ...
- ChatGPT API FAQ
ChatGPT API FAQ General questions about the ChatGPT API Written by Johanna C.. Updated over a week a ...
- gson如何序列化子类
需求 目前有一个需求,不同对象有一些公共属性,分别也有一些不同的属性.对方传过来的json字符串中,把这些对象组成了一个数组返回过来的.这样该如何反序列化呢? 举例 定义Person类.Student ...
- kafka和zookeeper安装
一.Kafka简介 Kafka 被称为下一代分布式消息系统,是非营利性组织ASF(Apache Software Foundation,简称为ASF)基金会中的一个开源项目,比如HTTP Server ...