Advertisement
Josif_tepe

Untitled

Feb 14th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <stack>
  4. #include <queue>
  5. #include <algorithm>
  6. using namespace std;
  7. int main()
  8.     {
  9.         ios_base::sync_with_stdio(false);
  10.         int n;
  11.         int answer = 0;
  12.         cin >> n;
  13.         for(int i = 0; i < n; i++) {
  14.             string a, b;
  15.             cin >> a >> b;
  16.             sort(a.begin(), a.end());
  17.             sort(b.begin(), b.end());
  18.             if(a == b) {
  19.                 answer++;
  20.             }
  21.         }
  22.         cout << answer << endl;
  23.         return 0;
  24.     }
  25. // ({})
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement