#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1, s2 ;
int dl1, dl2, pom, pom1, T1[2]={0,0}, T2[2]={0,0} ;
cout << "Podaj wyraz: ";
cin >> s1;
cout << "Podaj wyraz: ";
cin >> s2;
dl1 = s1.size();
dl2 = s2.size();
if (dl1!=dl2) { cout << "NIE SA" << endl; }
else
{
for (int i=0; i<dl1; i++)
{
pom = (int)s1[i];
T1[pom-88]++;
pom = (int)s2[i];
T2[pom-88]++;
}
for (int i=0; i<2; i++)
{
if ( T1[i]!=T2[i]) {pom=1; break; }
}
if (pom==1) { cout << "nie jest" <<endl; }
else {cout << "jest anagramem" <<endl; }
}
return 0;
}