Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41800 | Jeremy | 蚱蜢跳跃 | C++ | Compile Error | 0 MS | 0 KB | 445 | 2024-02-23 11:47:52 |
#include<iostream> #include<cstring> #include<string> using namespace std; int main() { string str; getline(cin,str); int minn-1,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<<endl; else cout<<str.size()+1<<endl; return 0; }