zoukankan      html  css  js  c++  java
  • 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,"
    ");  
    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]=='	'||a[i]=='
    ')
    30         continue;
    31         else
    32         a[k++]=a[i];
    33     }
    34     a[k]='';
    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]='';  
    45             b[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 }
  • 相关阅读:
    Linux 4.11 内核变化
    c++设计模式
    【MySQL】undo,redo,2PC,恢复思维导图
    10053
    深入理解MySQL中的Redo、Undo、MVCC
    oracle 博客精选
    Linux内存中的Cache真的能被回收么?
    MySQL性能指标及计算方法 等待show processlist
    HTTP抓包工具Fiddler
    科来网络分析
  • 原文地址:https://www.cnblogs.com/wangmengmeng/p/4870781.html
Copyright © 2011-2022 走看看