Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- main()
- {
- char txt[100],c[100],v[100];
- int b,n,cv=0,cc=0;
- printf("Digite uma frase qualquer:");
- gets(txt);
- for(b=0; txt[b] != '\0'; b++)
- {
- if((txt[b] == 'a') || (txt[b] == 'e') || (txt[b] == 'i') || (txt[b] == 'o') || (txt[b] == 'u'))
- {
- v[cv] = txt[b];
- cv++;
- }
- else
- if(txt[b] == ' ')
- {
- }
- else
- {
- c[cc] = txt[b];
- cc++;
- }
- }
- v[cv] = '\0';
- c[cc] = '\0';
- system("CLS");
- printf("Vetor original:");
- puts(txt);
- printf("Vetor Vogais:");
- puts(v);
- printf("Vetor Consoantes:");
- puts(c);
- system("Pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement