Program not working for single input


error is coming for single input

@mohdkaifalam041 which one is your final code

@mohdkaifalam041
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
int s=0,i,n;
Scanner scn = new Scanner(System.in);
while(true)
{
n = scn.nextInt();
if(n>=-1000&&n<=1000)
{

         s=s+n;
		 if(s>=0)
		System.out.println(n);
		else break;
		}
		

	}
}

}
there is no bug in this code its get submitted

https://ide.codingblocks.com/s/177144 THIS ONE IS FINAL CODE

whats the problem your are facing its seems to be correct

BUT THE CODE YOU HAVE SEND IS HAVING ERRORS