Kann mir jemand ein Tipp geben?
thx
package de.codegym.task.task04.task0429;
/*
Positive und negative Zahlen
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//schreib hier deinen Code
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());
int anzahlP = 0;
int anzahlN = 0;
if(a>0 && a!=0){
anzahlP++;}
else {
anzahlN++;
}
if ( b>0 && b !=0) {
anzahlP++;
}
else {
anzahlN++; }
if (c>0 && c !=0) {
anzahlP++;
}
else {
anzahlN++;}
System.out.println("Anzahl negativer Zahlen: "+ anzahlN);
System.out.println("Anzahl positiver Zahlen: " + anzahlP);
}
}