社区讨论
悬关求助
P1580yyy loves Easter_Egg I参与者 2已保存回复 3
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 3 条
- 当前快照
- 1 份
- 快照标识符
- @mhjatfm9
- 此快照首次捕获于
- 2025/11/03 23:32 4 个月前
- 此快照最后确认于
- 2025/11/03 23:32 4 个月前
#9#10都过不了,输出和给的数据一样但就是过不了
CPP#include<bits/stdc++.h>
using namespace std;
int cnt=1;
string name1,name2;
void fir(string s){
int fi=s.find('@');
int kcnt=0;
for(int i=fi+1;i<s.size();i++){
if(s[i]==' ') kcnt++;
if(kcnt==3) break;
name1+=s[i];
}
}
void over1(){
cout<<"Unsuccessful"<<' '<<"@"<<name1<<' '<<"attempt"<<endl;
cout<<cnt<<endl;
cout<<name2;
}
int main(){
while(1){
string s;
getline(cin,s);
if(s.size()==1) break;
int kcnt=0;
for(int i=0;i<s.size();i++){
if(s[i]==' ') kcnt++;
if(kcnt==3){
name2=s.substr(0,i);
break;
}
}
string name11="@"+name1;
int cnt1=name11.size();
if(cnt==1){
fir(s);
cnt++;
continue;
}
else{
int flag=s.find(name1);
if(flag==-1){
over1();
return 0;
}
if(flag==0){
cout<<"Successful"<<' '<<"@"<<name1<<' '<<"attempt";
return 0;
}
int a1=s.find('@');
int a2=s.find('@',a1+1);
if(a2!=-1){
over1();
return 0;
}
}
cnt++;
}
cout<<"Unsuccessful"<<" "<<"@"<<name1<<' '<<"attempt"<<endl;
cout<<cnt-1<<endl;
cout<<"Good Queue Shape";
return 0;
}
回复
共 3 条回复,欢迎继续交流。
正在加载回复...