Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- int main () {
- int n;
- cin >> n;
- while (n!=0) {
- vector<int> v(26,0);
- char c;
- while(cin >> c and c != '.') {
- if (c >= 65 and c <= 90) ++v[c-65];
- if (c >= 97 and c <= 122) ++v[c-97];
- }
- while(cin >> c and c != '.') {
- if (c >= 65 and c <= 90) --v[c-65];
- if (c >= 97 and c <= 122) --v[c-97];
- }
- bool anagrama = true;
- for (int i = 0; i < 26 and anagrama; ++i) {
- anagrama = (v[i] == 0);
- }
- if (anagrama) cout << "SI" << endl;
- else cout << "NO" << endl;
- --n;
- }
- }
Add Comment
Please, Sign In to add comment