Tanky WooRSS

HDU/HDOJ 1073 Online Judge

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

题目传送门:

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

模拟题,比较水,这里注意一下空行的情况,我是用STL string做的,遇到空行时用一个符号如@代替。

代码:

#include 
#include 
#include 
using namespace std;

//string s1, s2, ss;
int n;

string fun(string &s;)
{
    string str;
    for(int i=0; i> n;
    getchar();
    while(n--)
    {
        string s1, s2, ss;
        cin >> ss;
        getchar();
        while(getline(cin, ss) && ss!="END")
        {
            if(ss == "")
                s1 += "@";
            else
                s1 += ss;
        }
        cin >> ss;
        getchar();
        while(getline(cin, ss) && ss!="END")
        {
            if(ss == "")
                s2 += "@";
            else
                s2 += ss;
        }
        getchar();
        if(s1 == s2)
        {
            cout << "Accepted" << endl;
            continue;
        }
        s1 = fun(s1);
        s2 = fun(s2);
        if(s1 == s2)
        {
            cout << "Presentation Error" << endl;
            continue;
        }
        else
            cout << "Wrong Answer" << endl;

    }

}