Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,j = 0,characters[5] = {0}, totalcharacters = 0, totalvowels = 0, namevowels[5] = {0};
- char nomes[][30] = { "Jose Oliveira",
- "Joao Silverio",
- "Joana da Silva",
- "Mario da Silva Oliveira",
- "Pedro Oliveira de Souza"};
- for (i = 0; i < 5; i++)
- {
- while (nomes[i][j] != '\0')
- {
- if (nomes[i][j] != ' ')
- {
- characters[i]++;
- totalcharacters++;
- }
- if (nomes[i][j] == 'a' || nomes[i][j] == 'e' || nomes[i][j] == 'i' || nomes[i][j] == 'o' || nomes[i][j] == 'u' || nomes[i][j] == 'A' || nomes[i][j] == 'E' || nomes[i][j] == 'I' || nomes[i][j] == 'O' || nomes[i][j] == 'U')
- {
- namevowels[i]++;
- totalvowels++;
- }
- j++;
- }
- j = 0;
- }
- for (i = 0; i < 5; i++)
- {
- printf("Nome %d : %d caracteres, %d vogais.\n",i+1,characters[i],namevowels[i]);
- }
- printf("Total de vogais = %d\nTotal de caracteres = %d\n",totalvowels,totalcharacters);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment