Right operation

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

In this task Your program should solve a puzzle in the form :
a ? b == c
In this puzzle a, b and c are nonnegative integers and are given as standard input (0<=a,b,c<=1e3), and Your task is to say, which operations satisfy the equation, so the equality holds.
At your disposal you have discussed already operations in C++:
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulo)

Your program should output a line with the solved puzzle, exchanging the ? symbol to the correct operation. the operation symbol and equality sign should be surrounded by single spaces.
We guarantee that for each puzzle there is at least one solution. If a puzzle has more than one solution, Your program should output ALL of them, in separate lines, in the order of equations described above.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

0 0 0

Sample output:

0 + 0 == 0
0 - 0 == 0
0 * 0 == 0

Sample input:_

2 2 4

Sample output:

2 + 2 == 4
2 * 2 == 4

Sample input:_

4 2 2

Sample output:

4 - 2 == 2
4 / 2 == 2

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o640.04982024/05/03 18:08:160B / 26B / 31B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o640.17272024/05/03 18:08:010B / 26B / 31B

Python _

RankUserSizeTimeDateStatistics
1fuzzylojik760.09582024/04/25 02:30:200B / 36B / 34B

Python3 _

RankUserSizeTimeDateStatistics
1fuzzylojik680.13892024/04/26 02:02:020B / 33B / 32B
2xnor680.25772024/04/27 12:14:270B / 29B / 36B
3orthoplex710.13792024/04/25 02:05:320B / 34B / 33B
4JunkIce1020.13742024/09/28 00:29:000B / 54B / 36B

JavaScript _

RankUserSizeTimeDateStatistics
1voytxt770.06112024/04/27 15:06:360B / 30B / 45B
2KrausRaus800.05842024/04/28 16:28:460B / 37B / 40B
3fuzzylojik810.05902024/04/28 09:24:220B / 32B / 45B

C++ _

RankUserSizeTimeDateStatistics
1hbert1390.04402024/04/25 03:04:480B / 68B / 61B
21430.04362024/04/25 02:55:310B / 69B / 64B

AWK _

RankUserSizeTimeDateStatistics
1Fleur490.04122024/05/24 15:44:440B / 11B / 34B
2sean730.04132024/05/01 03:30:120B / 26B / 47B

sed _

RankUserSizeTimeDateStatistics
1tails520.04172024/04/25 10:26:560B / 9B / 34B
2McBusLuck520.04352024/04/26 21:32:080B / 10B / 33B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1McBusLuck590.04482024/04/28 16:56:350B / 21B / 28B
2tails590.04362024/05/24 13:26:170B / 21B / 27B

bc _

RankUserSizeTimeDateStatistics
1fuzzylojik1080.04402024/05/01 04:14:530B / 40B / 35B
2McBusLuck1090.04322024/04/27 04:02:290B / 40B / 36B

dc _

RankUserSizeTimeDateStatistics
1Fleur9990.04142024/04/25 15:46:160B / ?B / ?B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o899.35792024/05/01 23:30:390B / 37B / 48B

Language Ranking_

RankLangUserSizeScore
1AWKFleur4910000
2sedtails529423
3Bash (builtins)McBusLuck598305
4Ruby2rotary-o647656
5Rubyrotary-o647656
6Python3fuzzylojik687205
7Pythonfuzzylojik766447
8JavaScriptvoytxt776363
9Scalarotary-o895505
10bcfuzzylojik1084537
11C++hbert1393525
12dcFleur999490

return to the top page