nikolas_serafini

Lista 5 - Exercício 14

Jul 6th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define MAX 50
  4. #define maxwords 30
  5.  
  6. int main()
  7. {
  8.   int i = 0, j;
  9.   char name[maxwords],names[MAX][maxwords];
  10.  
  11.   while (1)
  12.   {
  13.     printf("Entre com o nome : (digite 'fim' para sair)\n");
  14.     fflush(stdin);
  15.     gets(name);
  16.     if (strcmp(name,"fim") == 0)
  17.       break;
  18.     else {
  19.       strcpy(names[i],name);
  20.       i++;
  21.     }
  22.   }
  23.  
  24.   for (j = 0; j <= i ; j++) {
  25.     if (names[j][0] == 'A' || names[j][0] == 'a' || names[j][0] == 'E' || names[j][0] == 'e' || names[j][0] == 'I' || names[j][0] == 'i' || names[j][0] == 'O' || names[j][0] == 'o' || names[j][0] == 'U' || names[j][0] == 'u')
  26.       puts(names[j]);  
  27.   }
  28.  
  29.  
  30.   return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment