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
# -*- coding: utf-8 -*- | |
sumatoria_n1 = 0 | |
sumatoria_n2 = 0 | |
for x in range(10): | |
n1 = raw_input('Nota del alumno ' + str(x) + ' en matematica: ') | |
n2 = raw_input('Nota del alumno ' + str(x) + ' en fisica: ') | |
try: |
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 os | |
folder = raw_input('Dime la carpeta: \n') | |
lista = os.listdir(folder) | |
text_file = os.open('./lista_de_archivos.txt',os.O_CREAT|os.O_RDWR) |
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.Scanner; | |
public class bruno { | |
public static void main (String args[]) { | |
System.out.println("Dime hasta que numero quieres saber los numeros primos:"); | |
Scanner number = new Scanner(System.in); | |
Scanner print_prime = new Scanner(System.in); | |
int top_number = number.nextInt(); |
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.Scanner; | |
public class principal { | |
public static void main(String args[]) { | |
Scanner input = new Scanner(System.in); | |
int maximo = input.nextInt(); |
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 funciones { | |
public static void main (String args[]) { | |
long start = System.currentTimeMillis(); | |
fibonacci(); | |
long elapsedTimeMillis = System.currentTimeMillis()-start; | |
float elapsedTimeSec = elapsedTimeMillis/1000F; | |
System.out.println(elapsedTimeSec); |
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 Problema_OMA_4 { | |
public static void main(String[] args) { | |
/*¿Cuál es el mayor de los números racionales P / Q, tales que P y Q son números primos positivos, | |
P < Q y Q < 26662?*/ | |
double mayor_P_sobre_Q = 0; | |
double current_P_Q = 0; | |
for (long q = 24000; q < 26662; q++) { | |
for(long p = 23999; p<q; p++) { |
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 Problema_OMA_6 { | |
public static void main(String[] args) { | |
for (int x = 100000000 ; x<=999999999; x++) { | |
if (es_primo(x)) { | |
String X = Integer.toString(x); | |
String abc = X.substring(0,3); | |
String jkl = X.substring(3,6); |
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 Problema_OMA_3 { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
/* | |
a) ¿Cuántos números formados exclusivamente por los dígitos 3 y 7, y divisibles por 3 y por 7, son menores a 100000? | |
b) ¿Cuántos números formados exclusivamente por los dígitos 3 y 7, y divisibles por 3 y por 7, son menores a 100000000?*/ |
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
/* If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
Find the sum of all the multiples of 3 or 5 below 1000. */ | |
public class Problema_EULER_1{ | |
public static void main (String[] args) { | |
int sum_3 = 0, | |
sum_5 = 0; | |
for (int x =1; x<=1000; x++) { |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# En una grilla de 20x20 tenemos desde (0,0) hasta (20,20) es decir 20² combinaciones. | |
# lo que significa que para abarcar todas las posiciones tenemos que hacer 2 bucles anidados | |
# unit testing : | |
# 1*1 : 2 | |
# 2*2 : 6 | |
# 3*3 : 20 | |
# 4*4 : 70 | |
# (x,y) |
OlderNewer