Azul
Azul
Laranja
Laranja
Verde
Verde
def pascoa(x): # script python que define a função pascoa(x)
# em que x é o ano;
# (criado em ambiente IDLE).
#
# Baseado no algoritmo de O’Beirne, em 10 passos,
# para determinar a data do Domingo de Páscoa de um dado ano.
#
# (calcula o dia e o mês)
#
b = x / 100
c = x - 100 * b
quociente = (5 * b + c) / 19
a = 5 * b + c - 19 * quociente
d = (3 * (b + 25)) / 4
e = 3 * (b + 25) - 4 * d
g = (8 * (b + 11)) / 25
quociente = (19 * a + d - g) / 30
h = 19 * a + d - g - 30 * quociente
m = (a + 11 * h) / 319
j = (60 * (5 - e) + c) / 4
k = 60 * (5 - e) + c - 4 * j
quociente = (2 * j - k - h + m) / 7
l = 2 * j - k - h + m - 7 * quociente
n = (h - m + l + 110) / 30 # n é o mês (valor numérico)
q = h - m + l + 110 - 30 * n
quociente = (q + 5 - n) / 32
p = q + 5 - n # p é o dia
if n == 3:
N = 'Março' # N é o nome do mês
else:
N = 'Abril'
if quociente != 0:
print 'erro'
else:
print 'Em', x, 'o Domingo de Páscoa é no dia', p, 'de', N
def easter(x): # python script that defines the easter(x) function
# where x is the year;
# (created in the IDLE environment).
#
# Based on the 10 step O’Beirne's algorithm
# to compute the date of Easter Sunday of a given year.
#
# (computes the day and the month)
#
b = x / 100
c = x - 100 * b
quotient = (5 * b + c) / 19
a = 5 * b + c - 19 * quotient
d = (3 * (b + 25)) / 4
e = 3 * (b + 25) - 4 * d
g = (8 * (b + 11)) / 25
quotient = (19 * a + d - g) / 30
h = 19 * a + d - g - 30 * quotient
m = (a + 11 * h) / 319
j = (60 * (5 - e) + c) / 4
k = 60 * (5 - e) + c - 4 * j
quotient = (2 * j - k - h + m) / 7
l = 2 * j - k - h + m - 7 * quotient
n = (h - m + l + 110) / 30 # n is the month (numerical value)
q = h - m + l + 110 - 30 * n
quotient = (q + 5 - n) / 32
p = q + 5 - n # p is the day
if n == 3:
N = 'March' # N is the month name
else:
N = 'April'
if quotient != 0:
print 'error'
else:
print 'In', x, 'the Easter Sunday is on', N, p
| A | A2 |
| 2 | 4 |
| 3 | 9 |
| n | n2 | n 3 |
| 1 | 1 | 1 |
| 2 | 4 | 8 |
| 3 | 9 | 27 |
| 4 | 16 | 64 |
Alinhar dados ao centro
| n | n |
| 1 | 1 |
| 2 | 2 |
Este é um exemplo de texto marcado