Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- using namespace std;
- int nrap(char s[101],char c)
- {
- int nr=0,i;
- for(i=0;i<strlen(s);i++)
- {
- if (s[i]==c) nr++;
- }
- return nr;
- }
- int main()
- {
- char s1[100],s2[100],c;
- int i,ok=1,l1,l2;
- cin.getline(s1,100);
- l1=strlen(s1);
- cin.getline(s2,100);
- l2=strlen(s2);
- for(i=0;i<l1;i++) s1[i]=tolower(s1[i]);
- for(i=0;i<l2;i++) s2[i]=tolower(s2[i]);
- for(i='a';i<='z';i++)
- {
- if(nrap(s1,i)!=nrap(s2,i))
- {
- ok=0;
- break;
- }
- }
- if(ok!=0) cout<<"DA";
- else cout<<"NU";
- }
Add Comment
Please, Sign In to add comment