SHARE
TWEET

Untitled

a guest Jun 19th, 2019 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #define SIZE 256
  3. int main()
  4. {
  5.     int n;
  6.     scanf("%d", &n);
  7.     while (n--)
  8.     {
  9.         int frst[SIZE] = {0}, scnd[SIZE] = {0}, i, flag = 0;
  10.         char tmp;
  11.         while (scanf("%c", &tmp) && tmp != '\n') frst[(int)tmp]++;
  12.         while (scanf("%c", &tmp) && tmp != '\n') scnd[(int)tmp]++;
  13.         for (i = 0; i < SIZE; i++)
  14.         {
  15.             if (frst[i] || scnd[i])
  16.             {
  17.                 if (frst[i] && !scnd[i]) flag++;
  18.                 if (!frst[i] && scnd[i]) flag++;
  19.                 if (scnd[i] < frst[i]) flag++;
  20.             }
  21.         }
  22.         printf("%d: %s\n", i, flag ? "NO" : "YES");
  23.     }
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top