Advertisement
Zinak

Untitled

Sep 4th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int ts,i=0,flg;
  6. string s,t;
  7. cin>>ts;
  8. getchar();
  9. while(ts--)
  10. {
  11. int a[26]={0},b[26]={0};
  12. getline(cin,s);
  13. getline(cin,t);
  14. for(int j=0;s[j];j++)
  15. {
  16. if(s[j]>=65&&s[j]<=90) a[s[j]-65]++;
  17. else if(a[j]>=97&&a[j]<=122) a[s[j]-97]++;
  18. }
  19. for(int j=0;t[j];j++)
  20. {
  21. if(t[j]>=65&&t[j]<=90) b[t[j]-65]++;
  22. else if(t[j]>=97&&t[j]<=122) b[t[j]-97]++;
  23. }
  24. for(int j=0,flg=1;j<26;j++){
  25. if(a[j]!=b[j])
  26. {
  27. printf("Case %d: No\n",++i),flg=0;
  28. break;
  29. }
  30. }
  31. if(flg==1)printf("Case %d: Yes\n",++i);
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement