题目链接: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]='