viernes, 24 de octubre de 2014

Last Project Euler for 75

Problem 99 (Python ... painfully slow but easy to code):

maxn = 0;
ind = 1;
with open("base_exp.txt") as f:
     
    for line in f:
        base = int(line.split(",")[0]);
        exp = int(line.split(",")[1]);
        res = base ** exp;
        if(res > maxn):
            maxn = res
            print ind
        ind += 1;

No hay comentarios:

Publicar un comentario