I seem to be having this problem a lot. As with my other problems, the code is working and includes -1 in the sum but the verifier doesn't seem to catch it. Anyone have a solution?
package com.codegym.task.task04.task0442;
/*
Adding
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
String sNum = reader.readLine();
String sNum1 = reader.readLine();
String sNum2 = reader.readLine();
String sNum3 = reader.readLine();
String sNum4 = reader.readLine();
int num = Integer.parseInt(sNum);
int num1 = Integer.parseInt(sNum1);
int num2 = Integer.parseInt(sNum2);
int num3 = Integer.parseInt(sNum3);
int num4 = Integer.parseInt(sNum4);
while (true) {
int one = num;
int two = num1;
int three = num2;
int four = num3;
int five = num4;
if(one>0 && two>0 && three>0 && four>0 && five<0)
System.out.println(one+two+three+four+five);
break;
}
}
}