Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51.- C++ desde cero 2019🦸♂️ [Ejercicio 35.- Contar las vocales en un…
… string] Video: https://youtu.be/KTuco-EvLLE
- Loading branch information
1 parent
5de71e3
commit d359a21
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <iostream> | ||
|
||
int main(){ | ||
char texto[30]; | ||
int la=0,le=0,li=0,lo=0,lu=0; | ||
std::cout<<"Humano por favor ingresa una frase con vocales: "; | ||
std::cin.getline(texto,30,'\n'); | ||
for (int i = 0; i < 30; i++) | ||
{ | ||
switch (texto[i]) | ||
{ | ||
case 'a': la++; break; | ||
case 'A': la++; break; | ||
case 'e': le++; break; | ||
case 'E': le++; break; | ||
case 'i': li++; break; | ||
case 'I': li++; break; | ||
case 'o': lo++; break; | ||
case 'O': lo++; break; | ||
case 'u': lu++; break; | ||
case 'U': lu++; break; | ||
} | ||
} | ||
std::cout<<"Humano aqui estan las veces que escribites tus pinches vocales:\n"; | ||
std::cout<<"Letra a: "<<la<<"\n"; | ||
std::cout<<"Letra e: "<<le<<"\n"; | ||
std::cout<<"Letra i: "<<li<<"\n"; | ||
std::cout<<"Letra o: "<<lo<<"\n"; | ||
std::cout<<"Letra u: "<<lu<<"\n"; | ||
system("pause"); | ||
return 0; | ||
} |
Binary file not shown.