-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
2,340 additions
and
105 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/kotlin/CrisDev3.kt
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,39 @@ | ||
// sitio oficial de kotlin https://kotlinlang.org/ | ||
|
||
// comentario de una linea | ||
|
||
/* | ||
comentario de | ||
varias lineas | ||
*/ | ||
|
||
// Representación de una variable y una constante | ||
var variableExample = 1 | ||
val constantExample = 2 | ||
|
||
|
||
// Tipos de datos | ||
// Numericos | ||
var byteExample: Byte = 127 | ||
var integerExample: Int = 12 | ||
var shortExample: Short = -32768 | ||
var longExample: Long = 100000000000 | ||
var floatExample: Float = 2.1234567 | ||
var doubleExample: Double = 2.12345678911234567 | ||
|
||
// Alfanumericos | ||
var stringExample: String = "verde" | ||
var charExample: Char = '@' | ||
|
||
// Boolean | ||
var booleanExample: Boolean = true | ||
|
||
// Arrays | ||
var name = "Pancracio" | ||
var lastName = "Sanjur" | ||
var nickName = "TitoDev" | ||
var age = "26" | ||
|
||
val arrayExample = arrayListOf<String>(name, lastName, nickName, age) | ||
|
||
print("¡Hola, Kotlin!") |
137 changes: 137 additions & 0 deletions
137
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/c/miguelex.c
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,137 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
// operadores aritmeticos | ||
|
||
int a = 10; | ||
int b = 20; | ||
|
||
printf("Suma: %d\n", a + b); | ||
printf("Resta: %d\n", a - b); | ||
printf("Multiplicacion: %d\n", a * b); | ||
printf("Division: %d\n", a / b); | ||
printf("Modulo: %d\n", a % b); | ||
|
||
// operadores de asignacion | ||
|
||
a = 10; | ||
|
||
printf("Asignacion: %d\n", a); | ||
printf("Asignacion con suma: %d\n", a += 10); | ||
printf("Asignacion con resta: %d\n", a -= 10); | ||
printf("Asignacion con multiplicacion: %d\n", a *= 10); | ||
printf("Asignacion con division: %d\n", a /= 10); | ||
printf("Asignacion con modulo: %d\n", a %= 10); | ||
|
||
// operadores de incremento y decremento | ||
++a; // a = a | ||
printf("Incremento: %d\n", a); | ||
--a; // a = a | ||
printf("Decremento: %d\n", a); | ||
|
||
// operadores de relacion | ||
a = 10; | ||
|
||
printf("Igualdad: %d\n", a == b); | ||
printf("Desigualdad: %d\n", a != b); | ||
printf("Mayor que: %d\n", a > b); | ||
printf("Menor que: %d\n", a < b); | ||
printf("Mayor o igual que: %d\n", a >= b); | ||
printf("Menor o igual que: %d\n", a <= b); | ||
|
||
// operadores logicos | ||
a = 10; | ||
|
||
printf("AND: %d\n", a > 5 && a < 15); | ||
printf("OR: %d\n", a > 5 || a < 15); | ||
printf("NOT: %d\n", !(a > 5 && a < 15)); | ||
|
||
// operadores de desplazamiento | ||
|
||
a = 10; | ||
|
||
printf("Desplazamiento a la izquierda: %d\n", a << 2); | ||
printf("Desplazamiento a la derecha: %d\n", a >> 2); | ||
|
||
// operadores de bits | ||
|
||
a = 10; | ||
b = 7; | ||
printf("Bitwise AND: %d \n", a & b); | ||
printf("Bitwise OR: %d \n", a | b); | ||
printf("Bitwise XOR: %d \n", a ^ b); | ||
printf("Bitwise NOT: %d \n", ~a); | ||
|
||
// if else | ||
|
||
if (a > b) | ||
{ | ||
printf("a es mayor que b\n"); | ||
} | ||
else | ||
{ | ||
printf("a es menor que b\n"); | ||
} | ||
|
||
// switch case | ||
|
||
int option = 1; | ||
switch (option) | ||
{ | ||
case 1: | ||
{ | ||
printf("Realizar el registro de n usuarios\n"); | ||
break; | ||
} | ||
case 2: | ||
{ | ||
printf("Buscar usuario mediante su ID\n"); | ||
break; | ||
} | ||
default: | ||
{ | ||
printf("Este caso no existe!\n"); | ||
break; | ||
} | ||
} | ||
|
||
// for | ||
|
||
for (int i = 1; i <= 10; i++) | ||
{ | ||
printf("%d, ", i); | ||
} | ||
printf("\n"); | ||
|
||
// do while | ||
|
||
option = 0; | ||
do { | ||
printf("Ingrese 1 para salir del ciclo\n"); | ||
scanf("%d", &option); | ||
} while (option != 1); | ||
|
||
|
||
// while | ||
|
||
int i = 1; | ||
|
||
while (i <= 10) | ||
{ | ||
printf("%d, ", i); | ||
i++; | ||
} | ||
printf("\n"); | ||
|
||
// Extra | ||
|
||
for (int i = 10; i <= 55; i++) | ||
{ | ||
if (i != 16 && i % 2 == 0 && i % 3 != 0) | ||
{ | ||
printf("%d, ", i); | ||
} | ||
} | ||
printf("\n"); | ||
|
||
} |
103 changes: 103 additions & 0 deletions
103
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/python/ansuzgs.py
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,103 @@ | ||
# Operatdores | ||
|
||
# Aritméticos | ||
print(f"Suma: 2 + 2 = {2 + 2}") | ||
print(f"Resta: 2 - 2 = {2 - 2}") | ||
print(f"Multiplicacion: 2 * 2 = {2 * 2}") | ||
print(f"Division: 2 / 2 = {2 / 2}") | ||
print(f"Modulo: 2 % 2 = {2 % 2}") | ||
print(f"Exponente: 2 ** 2 = {2 ** 2}") | ||
print(f"Division entera: 2 // 2 = {2 // 2}") | ||
|
||
# Comparación | ||
print(f"Igual: 2 == 2 es {2 == 2}") | ||
print(f"Diferente: 2 != 2 es {2 != 2}") | ||
print(f"Mayor que: 2 > 2 es {2 > 2}") | ||
print(f"Menor que: 2 < 2 es {2 < 2}") | ||
print(f"Mayor o igual que: 2 >= 2 es {2 >= 2}") | ||
print(f"Menor o igual que: 2 <= 2 es {2 <= 2}") | ||
|
||
# Lógicos | ||
print(f"And: True and True es {True and True}") | ||
print(f"Or: True or False es {True or False}") | ||
print(f"Not: not True es {not True}") | ||
print(f"Xor: True ^ False es {True ^ False}") | ||
|
||
# Asignación | ||
a = 5 | ||
print(f"Asignación: a = 2, a es {a}") | ||
a += 2 | ||
print(f"Suma: a += 2, a es {a}") | ||
a -= 2 | ||
print(f"Resta: a -= 2, a es {a}") | ||
a *= 2 | ||
print(f"Multiplicación: a *= 2, a es {a}") | ||
a /= 2 | ||
print(f"División: a /= 2, a es {a}") | ||
a %= 2 | ||
print(f"Módulo: a %= 2, a es {a}") | ||
a **= 2 | ||
print(f"Exponente: a **= 2, a es {a}") | ||
a //= 2 | ||
print(f"División entera: a //= 2, a es {a}") | ||
|
||
# Identidad | ||
print(f"Es: 2 is 2 es {2 is 2}") | ||
print(f"No es: 2 is not 2 es {2 is not 2}") | ||
|
||
# Pertenencia | ||
print(f"Está: 'a' in 'hola' es {'a' in 'hola'}") | ||
print(f"No está: 'a' not in 'hola' es {'a' not in 'hola'}") | ||
|
||
# Binarios | ||
print(f"And binario: 0b100 & 0b110 es {0b100 & 0b110}") | ||
print(f"Or binario: 0b100 | 0b110 es {0b100 | 0b110}") | ||
print(f"Xor binario: 0b100 ^ 0b110 es {0b100 ^ 0b110}") | ||
print(f"Desplazamiento izquierda: 0b100 << 2 es {0b100 << 2}") | ||
print(f"Desplazamiento derecha: 0b100 >> 2 es {0b100 >> 2}") | ||
|
||
# Estructuras de control | ||
|
||
# If | ||
a = 5 | ||
if a == 5: | ||
print(f"a es {a}") | ||
elif a == 3: | ||
print(f"a es {a}") | ||
else: | ||
print(f"a no es 5 ni 3") | ||
|
||
# While | ||
a = 0 | ||
while a < 5: | ||
print(f"a es {a}") | ||
a += 1 | ||
|
||
# For | ||
for a in range(5): | ||
print(f"a es {a}") | ||
|
||
# Break | ||
a = 0 | ||
while True: | ||
if a == 5: | ||
break | ||
print(f"a es {a}") | ||
a += 1 | ||
|
||
# Continue | ||
for a in range(5): | ||
if a == 2: | ||
continue | ||
print(f"a es {a}") | ||
|
||
# Excepciones | ||
try: | ||
a = 5 / 0 | ||
except ZeroDivisionError: | ||
print("No se puede dividir por 0") | ||
|
||
# Extra | ||
for number in range(10, 56): | ||
if number % 2 == 0 and number != 16 and number % 3 != 0: | ||
print(number) |
Oops, something went wrong.