Resto 2
Adaptado por Neilor Tonin, URI
BrasilTimelimit: 1Leia um valor inteiro N. Apresente todos os números entre 1 e 10000 que divididos por N dão resto igual a 2.
Entrada
A entrada contém um valor inteiro N (N < 10000).
Saída
Imprima todos valores que quando divididos por N dão resto = 2, um por linha.
URI Online Judge | 1075
Remaining 2
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
Read an integer N. Print all numbers between 1 and 10000, which divided by N will give the rest = 2.
Input
The input is an integer N (N < 10000)
Output
Print all numbers between 1 and 10000, which divided by n will give the rest = 2, one per line.
n = int(input())
for i in range(1,10001):
if i % n == 2:
print(i)
n = int(input())
for i in range(1,10001):
if i % n == 2:
print(i)
Nenhum comentário:
Postar um comentário