fork download
  1. #include <iostream>
  2. #include<algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. string s = "anagram",t = "nagaram";
  8.  
  9. sort(s.begin(),s.end());
  10. sort(t.begin(),t.end());
  11.  
  12. if(s==t) {
  13. cout<<"TRUE"<<endl;
  14. }
  15. else {
  16. cout<<"FALSE"<<endl;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
TRUE