Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41801 Xiyou 蚱蜢跳跃 C++ 通过 0 MS 244 KB 444 2024-02-23 11:48:00

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ string str; getline(cin,str); int minn=-1,tmp,last=0; bool flag=false; for(int i=0;i<str.size();i++){ if(str[i]=='A'||str[i]=='E'||str[i]=='I'||str[i]=='O'||str[i]=='U'){ flag=true; tmp=i-last; if(tmp>minn){ minn=tmp; } last=i; } } if(flag){ cout<<minn; } else{ cout<<str.size()+1; } return 0; }


测评信息: