quarta-feira, 24 de outubro de 2018

URI PROBLEMA 1038 - Lanche EM PYTHON

URI Online Judge | 1038

Lanche

Adaptado por Neilor Tonin, URI  Brasil
Timelimit: 1
Com base na tabela abaixo, escreva um programa que leia o código de um item e a quantidade deste item. A seguir, calcule e mostre o valor da conta a pagar.

Entrada

O arquivo de entrada contém dois valores inteiros correspondentes ao código e à quantidade de um item conforme tabela acima.

Saída

O arquivo de saída deve conter a mensagem "Total: R$ " seguido pelo valor a ser pago, com 2 casas após o ponto decimal.


URI Online Judge | 1038

Snack

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Using the following table, write a program that reads a code and the amount of an item. After, print the value to pay. This is a very simple program with the only intention of practice of selection commands.

Input

The input file contains two integer numbers and Yis the product code and is the quantity of this item according to the above table.

Output

The output must be a message "Total: R$ " followed by the total value to be paid, with 2 digits after the decimal point.




x = input().split()
a, b = x
if a == '1':
    print('Total: R$ {:.2f}'.format(4.00*float(b)))
if a == '2':
    print('Total: R$ {:.2f}'.format(4.50*float(b)))
if a == '3':
    print('Total: R$ {:.2f}'.format(5.00*float(b)))
if a == '4':
    print('Total: R$ {:.2f}'.format(2.00*float(b)))
if a == '5':
 print('Total: R$ {:.2f}'.format(1.50*float(b)))

Nenhum comentário:

Postar um comentário

URI PROBLEMA 1133 - Resto da Divisão SOLUÇÃO EM C

URI Online Judge | 1133 Resto da Divisão Adaptado por Neilor Tonin, URI   Brasil Timelimit: 1 Escreva um programa que leia 2 valo...