733A Grasshopper And the String codeforces(水题)

来源:互联网 发布:淘宝双11秒杀技巧 编辑:程序博客网 时间:2024/05/22 04:55
#include<bits/stdc++.h>using namespace std;int main(){    char str[105];    cin>>str;    int len=strlen(str);    for(int i=len-1;i>=0;i--)        str[i+1]=str[i];    int step=0,max1=0,now;    for(int i=1;i<=len;i++)    {        if(str[i]=='A'||str[i]=='E'||str[i]=='I'||str[i]=='O'||str[i]=='U'||str[i]=='Y')        {            now=i-step;            step=i;            max1=max(max1,now);        }    }    now=len-step+1;    max1=max(max1,now);    cout<<max1<<endl;    return 0;}

0 0
原创粉丝点击