Skip to content

Commit

Permalink
Merge pull request #3937 from RonnyG2121/main
Browse files Browse the repository at this point in the history
reto  #0 y #1  Python y C++
  • Loading branch information
Roswell468 authored Jun 26, 2023
2 parents f8b9af7 + c6ff0fa commit ff631ab
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/c++/ronnyg2121.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <iostream>
using namespace std;

int main(int argc, char const *argv[])
{
// Solución al ejercicio #0
for (int i = 0; i < 101; i++) {
if (i %3 == 0 && i %5 == 0) {
cout << "fizzbuzz\n" << endl;
}

else if (i %3 == 0) {
cout << "fizz\n" << endl;
}

else if(i %5 == 0) {
cout << "buzz\n" << endl;
}

else {
cout << i << endl;
}
}

return 0;
}
12 changes: 12 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/ronnyg2121.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Mi solución del ejercicio1

for i in range(1, 101, 1):
if i %3 == 0 and i %5 == 0:
print("fizzbuzz\n")

elif i %3 == 0:
print("fizz\n")
elif i %5 == 0:
print("buzz\n")
else:
print(f"{i}\n")
69 changes: 69 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/ronnyg2121.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@


# Método que se usa para convertir el carácter a código leet. Recibirá un parámetro para poder pasarle la información
def converter(text):

# Diccionario que le asigna el carácter correspondiente ca dada letra
dict_leet = {
"a": "4",
"b": "I3",
"c": "[",
"d": "|)",
"e": "3",
"f": "|=",
"g": "(_+",
"h": ")-(",
"i": "1",
"j": "]",
"k": "|<",
"l": "7",
"m": "|V|",
"n": "|\|",
"o": "()",
"p": "|>",
"q": "0_",
"r": "I2",
"s": "$",
"t": "-|-",
"u": "(_)",
"v": "\/",
"w": "\/\/",
"x": "×",
"y": "¥",
"z": "%",
"1": "L",
"2": "R",
"3": "E",
"4": "A",
"5": "S",
"6": "b",
"7": "T",
"8": "B",
"9": "g",
"0": "o"
}

# Variable usada para sumarle cada carácter a cada vuelta de bucle
resultado = ""

# Bucle for que recorre el diccionario y le asigna cada carácter donde corresponda
for i in text:
# Ignorando el carácter en minúscula o mayúscula y convirtiéndolo a string

i = str(i.lower())

# Comprobando si el carácter está en el diccionario
if i in dict_leet:
# Esto es lo que pasa el valor de cada clave en el diccionario
resultado += dict_leet[i]

# Si no está, se devuelve el carácter original
else:
resultado += i

# Regresamos la variable resultado
return resultado

# Probando el programa
entrada = input("Ingrese el texto a convertir y pulse enter")
print(converter(entrada))

0 comments on commit ff631ab

Please sign in to comment.