dalao求改 本机上案例过了 一交RE T-T
查看原帖
dalao求改 本机上案例过了 一交RE T-T
1355377
Guoshaoguan2023楼主2024/8/21 15:32

这是记录

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
	string a[5005],b,za="?",c;
	int sum=0;
	while((b=getchar())!="\n"){
		getline(cin,a[sum]);
		//a[sum].insert(0,b);
		sum++;
	}
	int temp;
	for(int i=0;i<sum;i++){
		if (a[i].find("@")!=string::npos&&a[i].rfind("@")==a[i].find("@")){
			c="yyy loves ";
			temp=a[i].find("loves",a[i].find(":"));
			temp+=6;
			for(;a[i][temp]!=' ';temp++){
				c+=a[i][temp];
			}
			if(za=="?"){
				za=c;
			}
			else{
				if(c!=za){
					cout<<"Unsuccessful "<<za<<" attempt"<<endl;
					cout<<i+1<<endl;
					c="yyy loves ";
					temp=a[i].find("loves");
					temp+=6;
					for(;a[i][temp]!=' ';temp++){
						c+=a[i][temp];
					}
					cout<<c;
					return 0;
				}
			}
		}
		else{
			c="yyy loves ";
			int temp=a[i].find("loves");
			temp+=6;
			for(;a[i][temp]!=' ';temp++){
				c+=a[i][temp];
			}
			if(c!=za){
				cout<<"Unsuccessful "<<za<<" attempt"<<endl;
				cout<<i+1<<endl;
				cout<<c;
			}
			else{
				cout<<"Successful "<<za<<" attempt";
			}
			return 0;
		}
	}
	cout<<"Unsuccessful "<<za<<" attempt"<<endl;
	cout<<sum<<endl;
	cout<<"Good Queue Shape";
	return 0;
}
2024/8/21 15:32
加载中...