Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. char x[55], y[55];
  7. int main()
  8.  
  9. {
  10. cin>>x>>y;
  11. int l=strlen(x);
  12. sort(x, x+l);
  13. sort(y, y+l);
  14. bool ok=true;
  15. for(int i=0; i<l && ok; i++)
  16. {
  17. if(x[i]!=y[i])
  18. ok=false;
  19. }
  20. if(ok)
  21. cout<<1;
  22. else
  23. cout<<0;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement