2743: string sentence, etc.View the total time limit for submitting statistics tips: 1000ms memory limit: 65536kB description Determines whether two strings consisting of uppercase and lowercase letters and spaces are equal after ignoring the case and compressing the spaces the input line 1th is the number of groups n for the test data, 2 rows for each set of test data, and the 1th line is the first string S1, line 2nd is the second string S2.
There is a blank row between each set of test data, with no more than 100 characters per row (note that the length of the string may be 0) output n rows, equal output Yes, otherwise output no sample input
3
a BB bb CCC CCC
Aa bbbb CCCCCC
a dfadf fasdf
Adasddfsfsaf
Sample output
Yes
Yes
NO
#include <stdio.h>
#include <string.h>
int main () {
int n;
Char str1[110],str2[110];
Char ctr1[110],ctr2[110];
scanf ("%d", &n); GetChar ();
for (int i=0;i<n;i++) {
str1[0]= ']; str2[0]= ';
ctr1[0]= ' ctr2[0]=
'; Gets (STR1);
Gets (STR2);
GetChar ();
if (i!=n-1) GetChar ();
int i1=0,i2=0;
int Num1=strlen (STR1);
int Num2=strlen (STR2);
for (int i=0;i<num1;i++) {
if (str1[i]!= ') {
if (str1[i]>= ' A ' &&str1[i]<= ' Z ')
ctr1[ i1++]=str1[i]+32;
else ctr1[i1++]=str1[i];
} Ctr1[i1]= ' ";
for (int i=0;i<num2;i++) {
if (str2[i]!= ') {
if (str2[i]>= ' A ' &&str2[i]<= ' Z ')
ctr2[ i2++]=str2[i]+32;
else ctr2[i2++]=str2[i];
} Ctr2[i2]= '//printf ' ("%s\n%s\n", ctr1,ctr2);
if (strcmp (CTR1,CTR2) ==0) {
printf ("yes\n");
} else printf ("no\n");
}
return 0;