#include #include #include #include #include #define N 50 bool anagram(char* s, char* t){ int a1[26]={0}, a2[26]={0}; int i,j; while(*s && *t){ i= *s - 'a'; j= *t - 'a'; a1[i] ++; a2[j] ++; s++; t++; } for(int k=0; k<26; k++){ if(a1[k]!=a2[k]) return false; } return true; } int main() { char s[N], t[N]; scanf("%s%s",s,t); if(strlen(s)!=strlen(t)){ printf("%s and %s are Not Anagrams."); } else{ if(anagram(s,t)){ printf("%s and %s are Anagrams.",s,t); } else{ printf("%s and %s are Not Anagrams.", s,t); } } return 0; }