This file contains hidden or 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
memory = [0,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0] | |
"""Mapas de bits, a memória é | |
dividida em unidades de alocação. | |
Cada bit do mapa representa uma | |
unidade de alocação, sendo que se | |
o bit for 0, a unidade está livre; | |
caso contrário, a unidade está |
This file contains hidden or 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
references = {} | |
dictionary = [] | |
def randomized(x, y): | |
from random import randint | |
return randint(x, y) | |
def cracker_per_digit(x): |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <locale.h> | |
void menuPrincipal() { | |
printf("1 - Apurar votos\n"); | |
printf("2 - Computar votos\n"); | |
printf("3 - Sair\n"); | |
} | |
void menuCandidatos() { | |
printf("1 - Candidato 1\n"); |
This file contains hidden or 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
#Real | |
#1.6449340668482264 | |
#by python when m = 10**6 | |
#1.6449330668487701 | |
pi=3.14159265358979323846264338327950288419716939937510582097494459230781 | |
k = 1 | |
#m = infinity | |
#1/k**4=pi**2/6 | |
m=1000 | |
tmp=1/k**2 |
This file contains hidden or 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
print("k1 = 1") | |
print("k1+ k2 +...+ m = (m*(m+1))/2") | |
k = 1 | |
m=int(input("m = ")) | |
tmp = k | |
print("k = ",k) | |
print("sum = ", tmp) | |
while k < m: | |
k+=1 | |
tmp+=k |
This file contains hidden or 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
#1/0!+1/1!+1/2!+1/3!+1/4!+1/5!+1/6!... | |
#Real Euler's number | |
#e=2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178... | |
#by Python | |
#e=2.7182818284590455 | |
def factorial(z): | |
elist=[] | |
product=1 | |
while z>0: | |
elist.append(z) |
This file contains hidden or 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
global moedas | |
global personagem | |
global list | |
def aleatorio(x,y): | |
from random import randint | |
return randint(x,y) | |
def begin(): | |
global moedas |
This file contains hidden or 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
#1/4+1/4*2....=1/3 | |
x=0.25 | |
n=2 | |
while n!=30: | |
print(x,n) | |
x=x + 1/4**n | |
n+=1 | |
This file contains hidden or 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
#1=1/2+1/4+1/8.... | |
x=0 | |
y=1 | |
while y!=56: | |
x+=1/(2**y) | |
print ("y =",y) | |
print(x) | |
y+=1 |
This file contains hidden or 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
"""11-2=3**2 | |
1111-22=33**2 | |
111111-222=333**2""" | |
n = 1 | |
while n != 18 : | |
tmp = n | |
x = 0 | |
y = 0 | |
while tmp > 0: | |
x += 10**(tmp-1)*(10**(tmp-1) + 10**(tmp)) |
NewerOlder