Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41815 Songgy_King 蚱蜢跳跃 C++ 通过 1 MS 244 KB 485 2024-02-23 12:05:52

Tests(1/1):


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


测评信息: