题意:给一系列的输出和标准答案,比较二者是AC,PE或WA
字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cmath> 6 #include<queue> 7 #include<map> 8 using namespace std; 9 #define MOD 1000000007 10 const double eps=1e-5; 11 #define cl(a) memset(a,0,sizeof(a)) 12 #define ts printf("***** "); 13 const int MAXN=6005; 14 char a1[MAXN],a2[MAXN],b1[MAXN],b2[MAXN]; 15 int n,m,tt; 16 char temp[MAXN]; 17 void in(char a[],char b[]) 18 { 19 gets(temp); 20 while(strcmp(temp,"START")!=0) gets(temp); //START之前的都去掉 21 while(gets(temp)) 22 { 23 if(strcmp(temp,"END")==0) break; 24 if(strlen(temp)!=0) strcat(a,temp); //读入的不为换行符 25 strcat(a," "); 26 } 27 int t=0; 28 for(int i=0;i<strlen(a);i++) 29 { 30 if(a[i]!=' '&&a[i]!=' '&&a[i]!=' ') // 要加,因为题目中有要求,汗 31 { 32 b[t++]=a[i]; 33 } 34 } 35 b[t]='