Untitled
unknown
c_cpp
2 years ago
485 B
16
Indexable
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
bool anaAre(const string& a, const string& b) {
if (a.length() != b.length()) {
return false;
}
string soA = a;
string soB = b;
sort(soA.begin(), soA.end());
sort(soB.begin(), soB.end());
return soA == soB;
}
int main() {
string a, b;
cin >> a >> b;
if (anaAre(a, b)) {
cout << "1\n";
} else {
cout << "0\n";
}
return 0;
}
Editor is loading...