hdu Online Judge

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073

 

数据判断,主要是如何判断WA和PE,吸收字符!

 

代码:

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <math.h>
 4 #include <algorithm>
 5 #include <iostream>
 6 #include <ctype.h>
 7 #include <iomanip>
 8 #include <queue>
 9 #include <stdlib.h>
10 using namespace std;
11 
12 char tmp[5050];
13  
14 void shuru(char p[])  
15 {  
16     getchar();  
17     gets(tmp);  
18     while(gets(tmp))  
19     {  
20         if(strcmp(tmp,"END")==0) break;  
21         if(strlen(tmp)!=0) strcat(p,tmp);  
22         strcat(p,"\n");  
23     }  
24 }  
25 
26 void duibi(char a[]){
27     int k=0;
28     for(int i=0;a[i];i++){
29         if(a[i]==' '||a[i]=='\t'||a[i]=='\n')
30         continue;
31         else
32         a[k++]=a[i];
33     }
34     a[k]='\0';
35 }
36 
37 int main()
38 {
39     int n;
40     char a[5050];
41     char b[5050];
42     while(~scanf("%d",&n)){
43         while(n--){
44             a[0]='\0';  
45             b[0]='\0';
46             shuru(a);  
47             shuru(b);;
48             if(strcmp(a,b)==0){
49                 cout<<"Accepted"<<endl;
50                 continue;
51             }
52             else{
53                 duibi(a);
54                 duibi(b);
55                 if(strcmp(a,b)==0){
56                     puts("Presentation Error");  
57                     continue;  
58                 }
59             }
60             puts("Wrong Answer"); 
61         }
62     }
63     return 0;
64 }

 

转载于:https://www.cnblogs.com/wangmengmeng/p/4870781.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值