fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int t;
  7. cin>>t;
  8. while(t--)
  9.  
  10. {
  11. string str1;cin>>str1;
  12. string str2;cin>>str2;
  13. int n1 = str1.length();
  14. int n2 = str2.length();
  15. sort(str1.begin(), str1.end());
  16. sort(str2.begin(), str2.end());
  17. for (int i = 0; i < n1; i++)
  18. if (str1[i] != str2[i])
  19. cout<<"false"<<"\n";
  20. else
  21. cout<<"true"<<"\n";
  22. }
  23.  
  24. // your code goes here
  25. return 0;
  26. }
Success #stdin #stdout 0s 5456KB
stdin
4
a a
b h
stop post
hi hey
stdout
true
false
true
true
true
true
false
false