Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int ts,i=0,flg;
- string s,t;
- cin>>ts;
- getchar();
- while(ts--)
- {
- int a[26]={0},b[26]={0};
- getline(cin,s);
- getline(cin,t);
- for(int j=0;s[j];j++)
- {
- if(s[j]>=65&&s[j]<=90) a[s[j]-65]++;
- else if(a[j]>=97&&a[j]<=122) a[s[j]-97]++;
- }
- for(int j=0;t[j];j++)
- {
- if(t[j]>=65&&t[j]<=90) b[t[j]-65]++;
- else if(t[j]>=97&&t[j]<=122) b[t[j]-97]++;
- }
- for(int j=0,flg=1;j<26;j++){
- if(a[j]!=b[j])
- {
- printf("Case %d: No\n",++i),flg=0;
- break;
- }
- }
- if(flg==1)printf("Case %d: Yes\n",++i);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement