URI Online Judge | 1073
Quadrado de Pares
Adaptado por Neilor Tonin, URI
Brasil
Timelimit: 1
Brasil
Leia um valor inteiro N. Apresente o quadrado de cada um dos valores pares, de 1 até N, inclusive N, se for o caso.
Entrada
A entrada contém um valor inteiro N (5 < N < 2000).
Saída
Imprima o quadrado de cada um dos valores pares, de 1 até N, conforme o exemplo abaixo.
Tome cuidado! Algumas linguagens tem por padrão apresentarem como saída 1e+006 ao invés de 1000000 o que ocasionará resposta errada. Neste caso, configure a precisão adequadamente para que isso não ocorra.
URI Online Judge | 1073
Even Square
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
Read an integer N. Print the square of each one of the even values from 1 to N including N if it is the case.
Input
The input contains an integer N (5 < N < 2000).
Output
Print the square of each one of the even values from 1 to N, as the given example.
Be carefull! Some language automaticly print 1e+006 instead 1000000. Please configure your program to print the correct format setting the output precision.
n = int(input())
x = 2
for i in range(2 , n + 1 , 2):
print('{}^2 = {}'.format(i, i **2))
n = int(input())
x = 2
for i in range(2 , n + 1 , 2):
print('{}^2 = {}'.format(i, i **2))
Nenhum comentário:
Postar um comentário