URI Online Judge | 1037
Intervalo
Adaptado por Neilor Tonin, URI
Brasil
Timelimit: 1
Brasil
Você deve fazer um programa que leia um valor qualquer e apresente uma mensagem dizendo em qual dos seguintes intervalos ([0,25], (25,50], (50,75], (75,100]) este valor se encontra. Obviamente se o valor não estiver em nenhum destes intervalos, deverá ser impressa a mensagem “Fora de intervalo”.
O símbolo ( representa "maior que". Por exemplo:
[0,25] indica valores entre 0 e 25.0000, inclusive eles.
(25,50] indica valores maiores que 25 Ex: 25.00001 até o valor 50.0000000
[0,25] indica valores entre 0 e 25.0000, inclusive eles.
(25,50] indica valores maiores que 25 Ex: 25.00001 até o valor 50.0000000
Entrada
O arquivo de entrada contém um número com ponto flutuante qualquer.
Saída
A saída deve ser uma mensagem conforme exemplo abaixo.
URI Online Judge | 1037
Interval
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
You must make a program that read a float-point number and print a message saying in which of following intervals the number belongs: [0,25] (25,50], (50,75], (75,100]. If the read number is less than zero or greather than 100, the program must print the message “Fora de intervalo” that means "Out of Interval".
The symbol '(' represents greather than. For example:
[0,25] indicates numbers between 0 and 25.0000, including both.
(25,50] indicates numbers greather than 25 (25.00001) up to 50.0000000.
[0,25] indicates numbers between 0 and 25.0000, including both.
(25,50] indicates numbers greather than 25 (25.00001) up to 50.0000000.
Input
The input file contains a floating-point number.
Output
The output must be a message like following example.
if 0<= x <= 25:
print('Intervalo [0,25]')
if 25< x <= 50:
print('Intervalo (25,50]')
if 50< x <= 75:
print('Intervalo (50,75]')
if 75< x <= 100:
print('Intervalo (75,100]')
if x >100 or x<0:
print('Fora de intervalo')
Nenhum comentário:
Postar um comentário