Calculadora amb menú


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C#, Go, Java

Realitza un programa que soliciti dos nombres i mostri per pantalla el següent menú:

MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:

L'usuari escullirà una opció i el programa finalitzarà mostrant el resultat per pantalla.

Input Format

L'entrada consta de 3 nombres:

  • Els dos primers \(A\) i \(B\) son els operands.
  • El tercer nombre \(Op\) és l'opció del menú seleccionada

Constraints

Totes les operacions són enteres i no hi ha cap divisor que sigui 0.

Output Format

S'imprimirà el resultat de l'operació

Test Case 1

Input
1 1     1
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
2

Test Case 2

Input
1 1     2
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
0

Test Case 3

Input
1 1     3
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
1

Test Case 4

Input
1 1     4
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
1

Test Case 5

Input
2 2     1
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
4

Test Case 6

Input
2 3     2
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
-1

Test Case 7

Input
2 5     3
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
10

Test Case 8

Input
10 5     4
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
2

Test Case 9

Input
3456 678     3
Output
MENU:
1.-SUMAR
2.-RESTAR
3.-MULTIPLICAR
4.-DIVIDIR
Esculli una opcio:
2343168

Authorship: Gerard Falcó

CC BY-NC-SA 4.0