Submit | All submissions | Best solutions | Back to list |
GALAXY - A Simple Calculator in the Galaxy |
Background
So if you want to survive the Earth's demise and see the galaxy, make sure you are wearing something more substantial than pajamas and a ratty bathrobe, watch the skies for flying saucers, start worrying when all the dolphins on the planet vanish, and keep your eyes peeled for an electronic gizmo with the words "Don't Panic" printed in large friendly letters on the cover.
--The Hitchhiker's Guide to the Galaxy
Problem
Addition,subtration and multiplication is necessary wherever you are in the galaxy.You are to write a program to perform these operations, and you can see 6*7=42 or 67-25=42 or 31+11=42, maybe one of them is the problem of Life, the Universe and Everything.
Please note that the solution may only be submitted in Brainf**k, Whitespace and Intercal, other languages like C/C++/Pascal/Java are not allowed! If you want to use other languages to solve this problem, you may try this one.
Input
Multiple test cases, the number of them T is given in the very first line, T<=99.
Each test case contains one line which has the following form:
num oper num
where num is an integer number between 1 and 99, and oper is '+' or '-' or '*' (without quotes).
There's no extra whitespace and leading zero in the input.
Output
For each test case you should output one line which contains the answer without any leading zeros.You may assume this number is always a positive one.
Example
Input: 3 6*7 67-25 31+11 Output: 42 42 42
Added by: | Fudan University Problem Setters |
Date: | 2007-04-01 |
Time limit: | 5s |
Source limit: | 17000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | BF ICK WHITESPACE |
Resource: | Folklore, description and test data by Blue Mary |
hide comments
2015-02-24 12:13:22 (Tjandra Satria Gunawan)(曾毅昆)
@Smithers: when I submit this problem using BF, I still newbie on BF language (1 month before I solve this problem I know nothing abut BF) |
|
2014-10-30 21:23:47 Smithers
tjandra: Why do you make things so hard for yourself? I only needed 297 characters (54 operations) of WSPC! |
|
2012-07-25 10:19:56 (Tjandra Satria Gunawan)(曾毅昆)
Largest BF code that I ever submit... (1379 command!) |