Chef proxy

Sir, my output is coming correct but the online comipler is showing it wrong answer please the code and tell me the problem

What do you calculate on line 33??


1 Like

Consider the test input:


buddy, its increasing the number of day chef is present so that i can calculate percentage

friend it is showing 0, because its attendence is full already so his friend don’t have to do any proxy

1 Like

You add it every time you call the loop, it should be inside the inner if, and
something like p=p+1
EDIT: solution

On my machine, it’s showing -1 - you have Undefined Behaviour in your code.

1 Like

thx for help buddy.

Before running the loop, you didn’t check if the condition pr>=75 is already true