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] 题目大意是说,只有一个数字非零的数是幸运的,给出一个数,求下一个幸运的数是多少. 这个幸运的数不是最高位的数字都是零,于是只跟最高位有 ...
随机推荐
- CodeForces 1388D Captain Flint and Treasure
题意 给长度为\(n\)的序列\(a[n]\)和\(b[n]\),初始时\(ans=0\),有以下操作: \(ans=ans+a[i]\) 如果\(b[i]\neq-1\),则\(a[b[i]]=a[ ...
- C++算法之旅、05 基础篇 | 第二章 数据结构
常用代码模板2--数据结构 - AcWing 笔试用数组模拟而不是结构体 使用结构体指针,new Node() 非常慢,创建10万个节点就超时了,做笔试题不会用这种方式(优化是提前初始化好数组,但这样 ...
- 别再用 float 布局了,flex 才是未来!
大家好,我是树哥! 前面一篇文章整体介绍了 CSS 的布局知识,其中说到 float 布局是 CSS 不断完善的副产物.而在 2023 年的今天,flex 这种布局方式才是未来!那么今天我们就来学习下 ...
- 图解Spark排序算子sortBy的核心源码
原创/朱季谦 一.案例说明 以前刚开始学习Spark的时候,在练习排序算子sortBy的时候,曾发现一个有趣的现象是,在使用排序算子sortBy后直接打印的话,发现打印的结果是乱序的,并没有出现完整排 ...
- Github 组合搜索开源项目 (超详细)
例如搜索 Spring Boot 相关项目 spring boot (最简单最常用) in:name spring boot (匹配项目名字) in:name spring boot stars: ...
- fprintf
fprintf 是一个标准C库函数,用于将格式化的输出写入到指定文件流中.它的函数原型如下: int fprintf(FILE *stream, const char *format, ...); 参 ...
- Python+SVM
# !/usr/bin/env python # encoding: utf-8 # SVM算法 支持向量机 from sklearn import svm import numpy as np fr ...
- 高效技巧揭秘:Java轻松批量插入或删除Excel行列操作
摘要:本文由葡萄城技术团队原创并首发.转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者. 前言 在职场生活中,对Excel工作表的行和列进行操作是非常普遍的需求 ...
- 一分钟理解TCP重传
为什么需要重传 任何信息在介质中传输可能丢失,这是由于传输介质的物理特性决定的,所以网络不可能被设计为"可靠的"(不是由于考虑"性能"原因而是压根做不到).既然 ...
- 手撕Vuex-模块化共享数据上
前言 好,经过上一篇的介绍,实现了 Vuex 当中的 actions 方法,接下来我们来实现 Vuex 当中的模块化共享数据(modules). modules 方法用于模块化共享数据,那么什么叫模块 ...