Diagnostic Test 2016 Level 1

Problem 1: StarMath

The members of team starfax learned math in an unconventional way such that they were unable to use calculators. Instead of addition, subtraction, multiplication, and division, with the numbers a and b, the equation a $ b equals a2b2, the equation a @ b equals (b * a) / (2a − 3), and the equation a # b equals (a * b) (b − 14). Due to this being so hard without calculators, the students requested you to make a program for them. Given the integers a and b (-1000 ≤ ab ≤ 1000), and an operand o ($, @, or #), calculate the answer to the provided question. Output the string "The equation [a] [o] [b] is equal to [answer]." The answer will always be an integer after calculations.

Sample Input

3
$
7

Sample Output

The equation 3 $ 7 is equal to -40.

Sample Input

4
#
0

Sample Output

The equation 4 # 0 is equal to 0.

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 13, 2016
Authors: Geerthan, imaxblue

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

My code works on windows cmd but not here?