Summing Up problem?

Back to General discussions forum

Goodwin Lu     2015-12-07 01:21:48

I tried solving the summing up problem, yet dispite getting the right answer, the expected answer tells me I'm wrong. The program is as follows:

int a= input("Enter first number";)>
int b = input("Enter second number";) 
int sum = a + b
print(a<:)
print(b>:)
Public static void main (string <[- a > + b < ] args) {
print (sum>:)        }

Without all the "Show off pseudo-Python Java Nonsense": ";>;<:>:<[->+<]>:" (Without the quotes)

Sample answer: 13 28 41 Expected answer: Code does not return 41 as output ????!

Rodion (admin)     2015-12-07 05:35:51
User avatar

Hi! Thanks for your question!

You see, the problem statement expects a single value as an answer from you. But your program outputs three times. I'm afraid you want too much from the checker - it could not guess that the answer in your case should be the third value of thre... :)

Goodwin Lu     2015-12-07 16:11:11

The output still fails if I only output the sum....?

Rodion (admin)     2015-12-08 09:04:22
User avatar

I looked at your last submitted code (via link at your profile page) and it does not look like output only the sum... It still have 3 output operators.

When this code is submitted it is run on the server side and it still yields not the result you wanted.

Goodwin Lu     2015-12-09 16:42:07

I later changed the code to only out put the sum, but that failed too :/

Goodwin Lu     2015-12-09 16:42:47

Cell 0 contains wrong value ...

Quandray     2015-12-09 17:57:03
User avatar

Hi,

As well printing the sum of A+B, when your code ends it needs to have A in cell 0, B in cell 1 and A+B in cell 2.

Your code is changing cell 0, so you are getting the message "Cell 0 contains wrong value"

Goodwin Lu     2015-12-09 18:18:54

hmmm.... So I need A in 0, B in 1, without outputting them, and a+b the only one being out putted, am I right?

Quandray     2015-12-09 19:23:17
User avatar

Yes, read the 1st number into cell 0, read the 2nd number into cell 1, calculate the sum of the two numbers into cell 2 (without changing cells 0 & 1) then output the sum.

Goodwin Lu     2015-12-09 20:24:26

oof, no wonder it's just a late problem. Pretty hard; guess I'll try later.

Please login and solve 5 problems to be able to post at forum