Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- bool ana (string s1, string s2) {
- if (s1.size() != s2.size()) {
- return false;
- }
- int Ts[2][3];
- Ts[0][0] = 0;
- Ts[0][1] = 0;
- Ts[0][2] = 0;
- Ts[1][0] = 0;
- Ts[1][1] = 0;
- Ts[1][2] = 0;
- int i = 0;
- while (true) {
- if (int(s1[i]) == 0) {
- break;
- } else {
- Ts[0][int(s1[i])-65]++;
- Ts[1][int(s2[i])-65]++;
- }
- i++;
- }
- if (Ts[0][0] == Ts[1][0] && Ts[0][1] == Ts[1][1] && Ts[0][2] == Ts[1][2]) {
- return true;
- }
- return false;
- }
- int main () {
- string s1;
- cin >> s1;
- string s2;
- cin >> s2;
- cout << ana (s1, s2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement