could u plz tell me y my code is wrong and where my code fails? my code works for all the cases in this forum too... give me a case where i waste pizza...thanks in advance
Read the second post in this topic.
81/41/41/41/43/43/43/43/4my output is 5.. y should it not be 5 and how it'll be 6? i've read the problem statement 5 times... can't able to figure out how it is 6.pizza 1 shared by person 1 and person 5pizza 2 shared by person 2 and 6pizza 3 for persons 3 and 7pizza 4 for persons 4 and 8+ 1 pizza for abotrikaso totally only 5 pizzas are required..... am i wrong? plz explain...
Unfortuanately, it is not.If it is, then you have updated your code but not reflected it here on the forum.
@leppy - hi friend ..i tried my code for all possible test cases and it worked well .. can u give me a test case where it fails ...thx
I'd love to take a look at your code. Unfortunately, i'm not psychic and can't look at it if you don't post it
Also, i'm pretty sure you didn't check ALL possible test cases. Such an endeavor would take quite some time.
actually i posted the code in my previous post
Removed old code
From my response to your previous post:
i understood my mistake... sorry
hi i scanned my code and thought all possibilities ..can u plz tell me where i m going wrong or can u plz give me a test case where my code would fail ..thx in advance
Would you really throw out half of a pizza and buy one for a quarter?
ac
never use getchar() for newlines !!
Using getchar leads to many wrong answers. The end of line may or may not be \r\n which is two characters. Just use scanf instead and pull the 0 and 2 character.
thanks a lot leppy got ac
hey leppy please tell me how to remove my source code from here
After you login you can browse to the post and click the edit button.
@leppy - hi thx a lot got ac
Could you tell me whats wrong with this code?it works for all the test cases i have tried.
[code Removed]
This topic is three pages long. Read every post and note the common theme and fix the problem.
If you still have questions please post back.
PS: scanf("%c") and getchar function the same.
I can't find the case Im not accounting for. Can anyone see it? Or is my logic wrong? Where?
removed old code