May 18, 2015 at 2:00am
Based on cpp.sh, it is correct?
What do you mean "lesser by 1"? Like 5^3 to 6^3 is 340? I ran it and it computes 341.
Last edited on May 18, 2015 at 2:02am
May 18, 2015 at 2:10am
Your code worked for me. I used 6, 7, 8, 9, and 10 for N and it was right every time.
Last edited on May 18, 2015 at 2:10am
May 18, 2015 at 3:27am
Thats weird, it comes out as incorrect for me.
I just tried 6 and 7 and 10, and the output is always 1 less than the correct answer i.e. If I enter a 7, output is 683 when it should be 684.
Why are you guys getting the correct answer and im not?
May 18, 2015 at 3:36am
I just ran it in the cpp shell. Its works fine there.
However, if I run it in my codeblocks compiler, I always get an output 1 less than the correct answer.
Any idea why this is happening?
May 18, 2015 at 3:40am
I have no idea. I ran it visual studio and it worked fine.
May 18, 2015 at 9:57am
What editor and compiler are you using?
Last edited on May 18, 2015 at 9:57am