Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41812 Songgy_King 蚱蜢跳跃 C++ 解答错误 1 MS 248 KB 500 2024-02-23 12:02:27

Tests(0/1):


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


测评信息: