刚开始使用容器不久,发现容器在使用之前貌似都是要清空的。
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cctype>
#include<cstdlib>
#include<stack>
#include<string>
using namespace std;
string s1,s2,s3,s4;
int main()
{
int T;
cin>>T;
while(T--)
{
s1=s2=s3=s4="";
int time=0;
while(getline(cin,s1)&&s1!="END")
{
if(time) s3+='\n';
s3+=s1;
time++;
}
time=0;
while(getline(cin,s2)&&s2!="END")
{
if(time) s4+='\n';
s4+=s2;
time++;
}
if(s3==s4)
cout<<"Accepted"<<endl;
else
{
s1=s2="";
int j=s3.length();
for(int i=0;i<j;i++)
if(s3[i]!='\n'&&s3[i]!='\t'&&s3[i]!=' ')
s1+=s3[i];
j=s4.length();
for(int i=0;i<j;i++)
if(s4[i]!='\n'&&s4[i]!='\t'&&s4[i]!=' ')
s2+=s4[i];
if(s1==s2)
cout<<"Presentation Error"<<endl;
else
cout<<"Wrong Answer"<<endl;
}
}
return 0;
}