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
public class Principal { | |
public static void main(String[] args) { | |
Plantilla p = new Plantilla(); | |
p.setTarea("A"); | |
// p.tarea = "A"; no permitido | |
p.setHiloPrimero(null); | |
Thread otro = new Thread(new Plantilla2()); | |
Thread h1 = new Thread(p); | |
Plantilla pp = new Plantilla("Tarea 2",h1); | |
Thread h2 = new Thread(pp); |
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
import java.util.*; | |
/** | |
Author: Luis Cobián | |
*/ | |
public class Main{ | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int n = sc.nextInt(); | |
float suma =0; | |
for(int i=0;i<n;i++){ |
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
EJERCICIO 1 | |
// algoritmo que me permite cambiar una hora dada en formato | |
// de 24 a 12 | |
// Luis Cobian | |
// 5 de Octubre | |
Algoritmo NumeroFormato24 | |
Escribir "Dame una hora:" | |
leer h | |
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
public class Taxi { //El nombre de la clase | |
private String ciudad; //Ciudad de cada objeto taxi | |
private String matricula; //Matrícula de cada objeto taxi | |
private String distrito; //Distrito asignado a cada objeto taxi | |
private int tipoMotor; //tipo de motor asignado a cada objeto taxi. 0 = desconocido, 1 = gasolina, 2 = diesel | |
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
<!doctype html> | |
<style> | |
textarea { vertical-align: bottom; } | |
#output { overflow: auto; } | |
#output > p { overflow-wrap: break-word; } | |
#output span { color: blue; } | |
#output span.error { color: red; } | |
</style> | |
<h2>WebSocket Test</h2> | |
<textarea cols=60 rows=6></textarea> |
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
+using Microsoft.SqlServer.Server; | |
+using System; | |
+using System.Collections.Generic; | |
+using System.Diagnostics; | |
+using System.Linq; |
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
import java.util.Arrays; | |
import java.util.Scanner; | |
public class EjemploMatriz { | |
public static void main(String[] args) { | |
/// arreglo de dos dimensiones | |
String[] nombres[] = new String[3][3]; | |
/// solo imprime una dimension |
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
public class Main{ | |
public static void main(String[] args) { | |
java.util.Scanner sc = new java.util.Scanner(System.in); | |
int n = sc.nextInt(); | |
int []arr = new int[n*2]; | |
for(int i=0;i<n*2;i++) | |
arr[i]=sc.nextInt(); | |
java.util.Arrays.sort(arr); | |
for(int i=n*2-1;i>=0;i--) | |
System.out.println(arr[i]); |
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
exp = 0 | |
# lista con todos los pesos que se quieren medir | |
lista = list() | |
while(exp<=14): | |
lista.append(2**exp) | |
exp+=1 | |
lista.reverse() | |
while True: | |
try: | |
# se le el tamaño del plato |
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
// clase para poder manejar numeros muy grandes | |
import java.math.BigDecimal; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
//leemos el numero el cual calcularemos el factorial |
NewerOlder