uva 11713 - Abstract Names Solution
11713 - Abstract Names -Solution
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int test,len1,len2,i;
char str1[25], str2[25],ch1,ch2;
cin >> test;
bool flag;
while (test--){
cin >> str1 >> str2;
len1 = strlen(str1);
len2 = strlen(str2);
flag = true;
if (len1 != len2)
flag = false;
else{
for (i = 0; i < len1; i++){
ch1 = str1[i];
ch2 = str2[i];
if (ch1 != ch2){
if (!((ch1 == 'a' || ch1 == 'e' || ch1 == 'i' || ch1 == 'o' || ch1 == 'u') && (ch2 == 'a' || ch2 == 'e' || ch2 == 'i' || ch2 == 'o' || ch2 == 'u'))){
flag = false;
break;
}
}
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
Comments
Post a Comment