Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 256
- int main()
- {
- int n;
- scanf("%d", &n);
- while (n--)
- {
- int frst[SIZE] = {0}, scnd[SIZE] = {0}, i, flag = 0;
- char tmp;
- while (scanf("%c", &tmp) && tmp != '\n') frst[(int)tmp]++;
- while (scanf("%c", &tmp) && tmp != '\n') scnd[(int)tmp]++;
- for (i = 0; i < SIZE; i++)
- {
- if (frst[i] || scnd[i])
- {
- if (frst[i] && !scnd[i]) flag++;
- if (!frst[i] && scnd[i]) flag++;
- if (scnd[i] < frst[i]) flag++;
- }
- }
- printf("%d: %s\n", i, flag ? "NO" : "YES");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement