Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gcc 5.4.0
- /*
- Nombre: Saúl Palma Ruiz.
- Paralelo: 2.
- Fecha: 08/09/2017
- */
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- //declaracion de variables
- int cantPal, i = 0, j = 0, largo=0;
- int conta=0, conte=0, conti=0, conto=0, contu=0;
- char vector[30+1];
- //vailadar el cantPal
- do{
- scanf("%d",&cantPal);
- }while((cantPal < 1) || (cantPal > 100));
- //usar un for para que poder validar todas las palabras
- for(i=0;i<cantPal;i++){
- scanf("%s",vector);
- largo = strlen(vector);//ver el largo
- //recorrer el vector char por char
- for(j = 0; j < largo; j++){
- //verificar si se encuentra la vocal
- if((vector[j] == 'a')||(vector[j] == 'A')){
- conta++;
- }
- if((vector[j] == 'e')||(vector[j] == 'E')){
- conte++;
- }
- if((vector[j] == 'i')||(vector[j] == 'I')){
- conti++;
- }
- if((vector[j] == 'o')||(vector[j] == 'O')){
- conto++;
- }
- if((vector[j] == 'u')||(vector[j] == 'U')){
- contu++;
- }
- }
- //Validar si estuvieron todas las vocales
- if((conta >= 1)&&(conte >= 1)&&(conti >= 1)&&(conto >= 1)&&(contu >= 1)){
- printf("SI\n");
- }else{
- printf("NO\n");
- }
- //limpieza de variables
- conta=0;
- conte=0;
- conti=0;
- conto=0;
- contu=0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment