HDU/HDOJ 1073 Online Judge 模拟题

水题~~~模拟即可。

题目传送门:

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <string>
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;
}

发布者

Tanky Woo

Tanky Woo,[个人主页:https://tankywoo.com] / [新博客:https://blog.tankywoo.com]

《HDU/HDOJ 1073 Online Judge 模拟题》有1个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注