Link: http://poj.grids.cn/practice/2743/
Question:
-
Total time limit:
-
1000 ms
-
Memory limit:
-
65536kB
-
Description
-
Determines whether two strings consisting of uppercase and lowercase letters and spaces are equal after the case is ignored or the space is compressed.
-
Input
-
The fifth row is the number of test data groups n, each group of test data occupies 2 rows, 1st rows are the first string s1, and 1st rows are the second string s2.
There is an empty row between each group of test data. Each row has no more than 100 characters (note that the string length may be 0)
-
Output
-
N rows. If n rows are equal, YES is output; otherwise NO is output.
-
Sample Input
-
3a A bb BB ccc CCCAa BBbb CCCccca dfadf fasdfadasddfsfsaf
-
Sample output
-
YESYESNO
Code:
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> cin>> s1[],s2[],s3[],s4[ (n-- len1 = len2 = idx1 = ( i = ; i < len1; i++ (s1[i] != (s1[i] >= && s1[i] <= ) s3[idx1++] = (s1[i]-) + s3[idx1++] = s3[idx1] = idx1 = ( i = ; i < len2; i++ (s2[i] != (s2[i] >= && s2[i] <= ) s4[idx1++] = (s2[i] - ) + s4[idx1++] = s4[idx1] = (strcmp(s3,s4)) cout<<<< cout<<<< }
Ideas:
1. Pay attention to empty rows between test instances