Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SUB 2 EX 4
- #include <iostream>
- #include <cstring>
- using namespace std;
- int v1[256],v2[256];
- int main()
- {
- char s1[101],s2[101];
- cin.getline(s1,256);
- cin.getline(s2,256);
- int i;
- for (i=0; i<strlen(s1); i++)
- if (s1[i] >='a' && s1[i]<='z')
- v1[s1[i]]++;
- for (i=0; i<strlen(s2); i++)
- if (s2[i] >='a' && s2[i]<='z')
- v2[s2[i]]++;
- for (i=0; i<=255; i++)
- if (v1[i] != v2[i])
- {
- cout<<"NU";
- return 0;
- }
- cout<<"DA";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement