Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41817 Xiyou 蚱蜢跳跃 C++ 通过 1 MS 252 KB 495 2024-02-23 12:06:38

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ char str[1000]; cin>>str; int minn=-1,tmp,last=0; bool flag=false; for(int i=0;i<strlen(str);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(str[i]=='\0'){ minn=max(minn,i-last); } } if(flag){ cout<<minn; } else{ cout<<strlen(str)+1; } return 0; }


测评信息: