codeforces733A.Grasshopper And the String
来源:互联网 发布:网站源码可以导出来吗 编辑:程序博客网 时间:2024/05/18 03:27
Formally, consider that at the begginning the Grasshopper is located directly in front of the leftmost character of the string. His goal is to reach the position right after the rightmost character of the string. In one jump the Grasshopper could jump to the right any distance from 1 to the value of his jump ability.
The following letters are vowels: 'A', 'E', 'I', 'O', 'U' and 'Y'.
The first line contains non-empty string consisting of capital English letters. It is guaranteed that the length of the string does not exceed 100.
Print single integer a — the minimum jump ability of the Grasshopper (in the number of symbols) that is needed to overcome the given string, jumping only on vowels.
ABABBBACFEYUKOTT
4
AAA
1
#include<iostream>#include<cstdio>using namespace std;int main(){char s[105];cin >> s;int t = 1,max=1;for (int i = 0; s[i] != '\0'; i++){if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O'|| s[i] == 'U' || s[i] == 'Y'){t = 1;continue;}t++;if (t > max) max = t;}printf("%d\n", max);return 0;}
- codeforces733A.Grasshopper And the String
- Grasshopper And the String
- Grasshopper And the String
- A. Grasshopper And the String
- A. Grasshopper And the String
- NYOJ Grasshopper And the String
- 【codeforces】Grasshopper And the String(div2A)
- Codeforces 733A Grasshopper And the String
- codeforces--733A. Grasshopper And the String
- CodeForces 733A - Grasshopper And the String
- 733A Grasshopper And the String
- Codeforces 733A Grasshopper And the String
- 【非常高%】【codeforces 733A】Grasshopper And the String
- Codeforces Round #378 (Div. 2)A. Grasshopper And the String
- Codeforces Round #378 (Div. 2) A. Grasshopper And the String
- codeforces#378 Div.2 A. Grasshopper And the String
- [codeforces] A. Grasshopper And the String 简单模拟
- 733A Grasshopper And the String codeforces(水题)
- Maven--打包的技巧
- RGB颜色查询对照表
- 一位文笔很好的作家--简媜
- Android FFMpeg 视频处理相关
- Android实战——okhttp3的使用和封装
- codeforces733A.Grasshopper And the String
- Android 调试命令
- shape的使用总结
- Servlet-字符流
- MySQL数据库设计总结
- JniHelper类里 getStaticMethodInfo参数详解
- Java集合之LinkedList
- 洛谷 P1190 接水问题
- js输入框提示输入字数校验