ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > IMPC - 2013-2014 > задача:


2013-04-10. 50335 - Five Math Operators

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 14-07-10. 50383 - Noisy Mornings
• 14-07-20. 50384 - Permutations revi...
• 14-07-30. 50385 - The 3n + 1 problem
• 14-07-50. 50367 - Bar Codes
• 2013-03-10. 50579 - Numrat pentag...
• 2013-03-20. 50589 - Numri i vezeve...
• 2013-03-30. 50559 - Faktoret e thje...
• 2013-03-40. 50685 - Perdorimi i dh...
• 2013-04-10. 50335 - Five Math ...
• 2013-04-100. 50323 - Filtering Cont...
• 2013-04-30. 50337 - Exam Averages
• 2013-04-40. 50338 - Convert Into ...
• 2013-04-50. 50774 - Hot Potato
• 2013-04-70. 50296 - Total Discount...
• 2013-04-80. 50343 - The number of...
• 2013-04-90. 50332 - Variance of a ...
• 2013-05-10. 50552 - Kepuce te perd...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 4000/7000/7000/7000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
bfs.

Five Math Operators

  Write a program that gets two integers and an operator from the keyboard and then does described operation using the given numbers.

  There are five operations:

  • '+' Addition: adds the second number to the first number
  • '-' Subtraction: Subtracts the second number from the first number
  • '*' Multiplication: Multiplies the first and the second numbers
  • '/' Integer division: Divides the first number by the second number producing integer result
  • '%' Modulus: Gives the remainder when the first number is divided by the second number

Input specification
  First, you will be given a number (n where 1 ≤ n ≤ 10). Then, each of the following n lines will contain an integer followed by a char and another integer: (e.g. 5+3). Char will be one of five operators (+, -, *, /, %) and the integers will be positive and less than 1000.

Output specification
  Show one number for every operation (line) which is the result of the given operator with the given numbers.

Sample Input:
  4
  45+20
  20-30
  7%3
  99/10

Sample Output:
  65
  -10
  1
  9


Для отправки решений необходимо выполнить вход.

www.contester.ru