有空格输入
P1580 yyy loves Easter_Egg I - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
#include<bits/stdc++.h>
using namespace std;
string a;string search(string s,int l){string kk;int spacesum=0;for(register int i=l;s[i]!=' '&&i<s.size();i++){if(s[i]==13) break;kk+=s[i];}return kk;
}
string find_name(string s){string a=search(s,10);return a;
}
int kkk(string q){int sum=0,gg;for(register int i=0;i<q.size();i++){if(q[i]=='@'){sum++;gg=i;}}if(sum!=1)return 0;else return gg;
}
string wss(string s){int g=kkk(s);if(g!=0)return search(s,g+11);else return "tenyearsatreehundredyearsatreeman";
}
int main()
{ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);getline(cin,a);string mega=wss(a);int jl=0;while(++jl){getline(cin,a);if(a.size()==1)break;//cout<<wss(a)<<' '<<mega<<' '<<"\n";if(find_name(a)==mega){cout<<"Successful @yyy loves "<<mega<<" attempt";return 0;}//轰炸成功else if(wss(a)!=mega){cout<<"Unsuccessful @yyy loves "<<mega<<" attempt"<<endl;cout<<jl+1<<endl;cout<<"yyy loves "<<find_name(a)<<endl;return 0;}//队形被破坏}cout<<"Unsuccessful @yyy loves "<<mega<<" attempt\n";cout<<jl<<"\n";cout<<"Good Queue Shape";//队形保持return 0;
}