Advertisement
nontawat1996

V4

Oct 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     int i;
  7.     int CountChar1[30]={0},CountChar2[30]={0};
  8.     char input1[300]={'\0'},input2[300]={'\0'};
  9.     gets(input1);
  10.     gets(input2);
  11.     for(i=0;i<strlen(input1);i++)
  12.     {
  13.         if(input1[i]>='A' && input1[i]<='Z')
  14.         {
  15.             input1[i]-='A'+1;
  16.             CountChar1[input1[i]]++;
  17.         }
  18.         else if(input1[i]>='a' && input1[i]<='z')
  19.         {
  20.             input1[i]-='a'+1;
  21.             CountChar1[input1[i]]++;
  22.         }
  23.     }
  24.  
  25.     for(i=0;i<strlen(input2);i++)
  26.     {
  27.         if(input2[i]>='A' && input2[i]<='Z')
  28.         {
  29.             input2[i]-='A'+1;
  30.             CountChar2[input2[i]]++;
  31.         }
  32.         else if(input2[i]>='a' && input2[i]<='z')
  33.         {
  34.             input2[i]-='a'+1;
  35.             CountChar2[input2[i]]++;
  36.         }
  37.     }
  38.     for(i=1;i<=26;i++)
  39.     {
  40.         if(CountChar1[i]!=CountChar2[i])
  41.         {
  42.             printf("no");
  43.             return 0;
  44.         }
  45.     }
  46.     printf("yes");
  47.     return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement