A. Superhero Transformation

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 
 4 #define N 1010
 5 char s[N], t[N], Hash[N];
 6 
 7 bool ok()
 8 {
 9     int n = strlen(s + 1);
10     for (int i = 1; i <= n; ++i) 
11         if (Hash[s[i]] != Hash[t[i]])
12             return false;
13     return true;
14 }
15 
16 int main()
17 {
18     memset(Hash, 0, sizeof Hash);
19     Hash['a'] = 1;
20     Hash['e'] = 1;
21     Hash['i'] = 1;
22     Hash['o'] = 1;
23     Hash['u'] = 1;
24     while (scanf("%s%s", s + 1, t + 1) != EOF)
25     {
26         int len1 = strlen(s + 1), len2 = strlen(t + 1);
27         if (len1 != len2) puts("No");
28         else
29             puts(ok() ? "Yes" : "No");
30     }
31     return 0;
32 }
View Code

相关文章: