提交时间:2024-02-23 11:48:00

运行 ID: 41801

#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; }