Test case error

Given a list of numbers, stop processing input after the cumulative sum of all the input becomes negative.

Input Format
A list of integers to be processed

Constraints
All numbers input are integers between -1000 and 1000.

Output Format
Print all the numbers before the cumulative sum become negative.

Sample Input
1
2
88
-100
49
Sample Output
1
2
88
Code Editor
Choose Language
Java 8

Provide Custom Input
Compile and Test Submit Code
1
2
88
-100
49
Failed Testcases
Dang! You couldn’t score a perfect 100 because you failed one or more testcases. This means that your program didn’t account for all input cases (did you account for negative numbers, for example?).
Test Cases
Result
Test Case 0 right
Test Case 1 wrong
Test Case 2 wrong
Test Case 3 right
Compile Message
Success

@Laibaqureshi227 hi, where in this question it is written that you have to take only 5 inputs?
Read this line carefully stop processing input after the cumulative sum of all the input becomes negative.

Here is my code for ya reference.
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int sum = 0;

    while(sum >= 0){

        int n = scn.nextInt();
        sum += n;

        if(sum < 0) break;
        System.out.println(n);
    }
}

}

Also if ya query is cleared, mark ya doubt as resolved and rate full!
Happy Coding!