zero is not a positive or negative number. Point me in the right direction. Don't give me the answer.
package com.codegym.task.task04.task0429;
/*
Positive and negative numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
if(a == 0 && b == 0 && c == 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 0");
}
else if(a > 0 && b == 0 && c == 0 || a == 0 && b > 0 && c == 0 || a == 0 && b == 0 && c > 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 1");
}
else if(a < 0 && b == 0 && c == 0 || a == 0 && b < 0 && c == 0 || a == 0 && b == 0 && c < 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 0");
}
else if(a > 0 && b < 0 && c == 0 || a < 0 && b > 0 && c == 0 || a == 0 && b > 0 && c < 0 || a == 0 && b < 0 && c > 0 || a > 0 && b == 0 && c < 0 || a < 0 && b == 0 & c > 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 1");
}
else if (a > 0 && b > 0 && c < 0 || a < 0 && b > 0 && c > 0|| b < 0 && a > 0 && c > 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 2");
}
else if (a < 0 && b < 0 && c > 0 || a > 0 && b < 0 && c < 0 || a < 0 && b > 0 && c < 0){
System.out.println("Number of negative numbers: 2");
System.out.println("Number of positive numbers: 1");
}
else if(a > 0 && b > 0 && c > 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 3");
}
else if(a < 0 && b < 0 && c < 0){
System.out.println("Number of negative numbers: 3");
System.out.println("Number of positive numbers: 0");
}
}
}
package com.codegym.task.task04.task0429;
/*
Positive and negative numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
if(a == 0 && b == 0 && c == 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 0");
}
else if(a > 0 && b == 0 && c == 0 || a == 0 && b > 0 && c == 0 || a == 0 && b == 0 && c > 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 1");
}
else if(a < 0 && b == 0 && c == 0 || a == 0 && b < 0 && c == 0 || a == 0 && b == 0 && c < 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 0");
}
else if(a > 0 && b < 0 && c == 0 || a < 0 && b > 0 && c == 0 || a == 0 && b > 0 && c < 0 || a == 0 && b < 0 && c > 0 || a > 0 && b == 0 && c < 0 || a < 0 && b == 0 & c > 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 1");
}
else if (a > 0 && b > 0 && c < 0 || a < 0 && b > 0 && c > 0|| b < 0 && a > 0 && c > 0){
System.out.println("Number of negative numbers: 1");
System.out.println("Number of positive numbers: 2");
}
else if (a < 0 && b < 0 && c > 0 || a > 0 && b < 0 && c < 0 || a < 0 && b > 0 && c < 0){
System.out.println("Number of negative numbers: 2");
System.out.println("Number of positive numbers: 1");
}
else if(a > 0 && b > 0 && c > 0){
System.out.println("Number of negative numbers: 0");
System.out.println("Number of positive numbers: 3");
}
else{
System.out.println("Number of negative numbers: 3");
System.out.println("Number of positive numbers: 0");
}
}
}