SelinD

ex25pg156

Jun 18th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. int nrap(char s[101],char c)
  6. {
  7. int nr=0,i;
  8. for(i=0;i<strlen(s);i++)
  9. {
  10. if (s[i]==c) nr++;
  11. }
  12. return nr;
  13. }
  14.  
  15. int main()
  16. {
  17. char s1[100],s2[100],c;
  18. int i,ok=1,l1,l2;
  19. cin.getline(s1,100);
  20. l1=strlen(s1);
  21. cin.getline(s2,100);
  22. l2=strlen(s2);
  23. for(i=0;i<l1;i++) s1[i]=tolower(s1[i]);
  24. for(i=0;i<l2;i++) s2[i]=tolower(s2[i]);
  25. for(i='a';i<='z';i++)
  26. {
  27. if(nrap(s1,i)!=nrap(s2,i))
  28. {
  29. ok=0;
  30. break;
  31. }
  32. }
  33. if(ok!=0) cout<<"DA";
  34. else cout<<"NU";
  35. }
Add Comment
Please, Sign In to add comment