Tanky WooRSS

HDU/HDOJ 1073 Online Judge 模拟题

03 Apr 2011
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

水题~~~模拟即可。

题目传送门:

http://acm.hdu.edu.cn/showproblem.php?pid=1073

#include 
#include 
using namespace std;

int main()
{
    int nCases;
    cin >> nCases;
    getchar();

    while(nCases--)
    {
        string s, s1, s2;
        getline(cin, s);
        while(getline(cin, s) && s!="END")
        {
            if(s == "")
                s = "#";
            s1 += s;
        }
        getline(cin, s);
        while(getline(cin, s) && s!="END")
        {
            if(s == "")
                s = "#";
            s2 += s;
        }
        if(s1 == s2)
        {
            cout << "Accepted" << endl;
            continue;
        }

        string s3,s4;
        for(int i=0; i<s1.size(); ++i)
        {
            if(s1[i]==' '|| s1[i]=='\t'|| s1[i]=='#') 
                continue;
            s3 += s1[i];
        }
        for(int i=0; i<s2.size(); ++i)
        {
            if(s2[i]==' '|| s2[i]=='\t'|| s2[i]=='#')
                continue;
            s4 += s2[i];
        }
        if(s3 == s4) 
            cout << "Presentation Error" << endl;
        else 
            cout << "Wrong Answer" << endl;

    }
    return 0;
}