Avishek99's blog

By Avishek99, history, 5 years ago, In English

Hi guys i have been check for my code many many times but i still confuse where is this error come from.... This error appear while build solution...Experts suggest please. And if you don't like this post,do not give negative vote..,just ignore it.It demotivated programmers. My code link is here : https://www.imageupload.net/image/capture3.mY8tQ

The problem statement link : https://codeforces.me/contest/1343/problem/B

  • Vote: I like it
  • +2
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +6 Vote: I do not like it

More context would help, as an end of file error is usually an error with syntax, and your syntax seems fine.

For future reference, I recommend you present your code in some sort of copy-pastable format instead of an image so people can run your code locally and better debug it.

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Will you provide the problem statement?

»
5 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

I am not so sure..but you can try this.... and when you want to end your program press Ctrl+z and enter...if this solve your problem then you are welcome otherwise very sorry...

include<stdio.h>

int main()

{

int t,n,i,j,sum1,sum2;

while(scanf("%d",&t)!=EOF)
{
    for(i=0;i<t;i++)
    {
        scanf("%d",&n);

    }
}

}

»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

You're using the same loop variable $$$i$$$ in both outer and inner loops, which messes up the outer loop and you probably read an incorrect amount of test cases.

In the future upload the code in copy-able format (e.g. pastebin or submission link) and definitely give the problem statement.