You are not logged in. Please login at www.codechef.com to post your questions!

×

My coding on computer shows right answer but on codechef it gives wrong ans

http://www.codechef.com/problems/COINS for this question i have written a code http://www.codechef.com/viewsolution/6885244 . Kindly let me know what is wrong with my code . I am a newbie and I am coding in C++ 4.3.2 what is wrong with my code ??????

asked 12 May '15, 16:35

aakashbhat's gravatar image

2★aakashbhat
122
accept rate: 0%

edited 12 May '15, 18:02


Declare y and z outside do while loop,otherwise they are getting repeatedly declared. Logic is correct . return sum only if sum>x(or y or z) otherwise it wont give correct answer Try for input 11 24 13 25 16 ans should be 11 27 13 25 17

link

answered 31 May '17, 18:01

abhishekp233's gravatar image

0★abhishekp233
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,714
×2,344
×1,911
×849
×518
×193
×9

question asked: 12 May '15, 16:35

question was seen: 6,223 times

last updated: 01 Jun '17, 17:11