#include <iostream>
#include <string>
#include <algorithm> // برای استفاده از sort()
using namespace std;
int main() {
string str1, str2;
// دریافت دو رشته از کاربر
cout << "Enter the first string: ";
getline(cin, str1);
cout << "Enter the second string: ";
getline(cin, str2);
// بررسی طول رشتهها
if (str1.length() != str2.length()) {
cout << "The strings are not anagrams." << endl;
return 0;
}
// مرتب کردن حروف هر دو رشته
sort(str1.begin(), str1.end());
sort(str2.begin(), str2.end());
// مقایسه رشتههای مرتب شده
if (str1 == str2) {
cout << "The strings are anagrams." << endl;
} else {
cout << "The strings are not anagrams." << endl;
}
return 0;
}