Advertisement
Saleh127

UVA 11713

Oct 9th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5.  
  6. ll vol(char ch)
  7. {
  8. if(ch=='a' || ch=='e' || ch=='i' || ch=='o'|| ch=='u')
  9. {
  10. return 1;
  11. }
  12. return 0;
  13. }
  14.  
  15. int main()
  16. {
  17. ios_base::sync_with_stdio(0);
  18. cin.tie(0);cout.tie(0);
  19.  
  20. string a,c;
  21. ll i,j,k,l;
  22. test
  23. {
  24. cin>>a>>c;
  25. l=0;
  26. if(a.size()!=c.size())
  27. {
  28. cout<<"No"<<endl;
  29. }
  30. else if(a==c) cout<<"Yes"<<endl;
  31. else
  32. {
  33. for(i=0;i<a.size();i++)
  34. {
  35. if(a[i]!=c[i])
  36. {
  37. if(vol(a[i])==1 && vol(c[i])==1)
  38. {
  39. continue;
  40. }
  41. else
  42. {
  43. l=1;
  44. break;
  45. }
  46. }
  47. }
  48. if(l) cout<<"No"<<endl;
  49. else cout<<"Yes"<<endl;
  50. }
  51. }
  52.  
  53.  
  54. return 0;
  55. }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement