Vivek-and-party

WHAT’S WRONG WITH THIS CODE
WANT TO KNOW MY MISTAKES

AND WHY
int n;
while (scanf("%d", &n) != EOF)

what is this and why it has been used instead of

cin>>n;

while(n–)

this means that n will take input until end of file.
You haven’t share your code correctly. While running it there are many compilation errors. share the right code or you can take reference from this.

what wrong in using int n;

cin>>n; while(n–)

and please mind mistakes in my code and tell me whats wrong in my code

please send me my updated code

check now
->


before sending your code, first do indentation of your code. Why this code wasn’t running was cause of value of n in your for loop.

thanks i will give you 5 star

its now showing me tle

https://ide.codingblocks.com/s/580480 look at this please consider it

your code is working fine, it’s just the issue with the input format which i told you earlier. Try to take input like i told you in the first code provided by me.
Using this

https://ide.codingblocks.com/s/580620 not able to sumbit this code whats wrong with this code

CHeck your inbox have replied to you there.

send me code that can be submiited

Try this

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.