# include <iostream>
# include <algorithm>

using namespace std;

bool isAnagram(string str1, string str2) {
	if str1.size() != str2.size()
		return false;
	sort(str1.begin(), str1.end());
	sort(str2.begin(), str2.end());
	return str1 == str2;
}

int main() {
	string str1, str2;
	cout << "Enter first string" << endl;
	cin >> str1;
	cout << "Enter second string" << endl;
	cin >> str2;

	cout << "Strings are anagram: " << isAnagram(str1, str2) << endl;

	return 0;
}

Check if strings are anagram
Check if strings are anagram
