Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3.  
  4. int main()
  5. {
  6.     unsigned int word = 0u;
  7.     unsigned int new_word = 0u;
  8.     unsigned int letter = 1u;
  9.     char c;
  10.     int summ = 0, unique = 0;
  11.     bool flag = true;
  12.  
  13.     scanf("%c", &c);
  14.  
  15.     while (c != EOF)
  16.     {
  17.         while((c != ' ') && (c != ',') && (c != '\t') && (c != '\n') && (c != EOF)){
  18.             if ((c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') ||(c == 'u')){
  19.                 summ++;
  20.                 letter = 1u << (c - 'a');
  21.                 new_word = new_word | letter;
  22.                 if( new_word != word ){
  23.                     unique++;
  24.                     word = new_word;
  25.                 }
  26.             }
  27.  
  28.             scanf("%c", &c);
  29.         }
  30.  
  31.         if ((summ == unique) && (summ != 0)){
  32.             printf("YES");
  33.             flag = false;
  34.             break;
  35.         }
  36.  
  37.         scanf("%c", &c);
  38.     }
  39.  
  40.     if (flag){
  41.         printf("NO");
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement