Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя Avishek99

Автор Avishek99, история, 4 года назад, По-английски

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

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Will you provide the problem statement?

»
4 года назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

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);

    }
}

}

»
4 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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.