Hello all,
Why i rcvd by add summe funct. the error message. I don't understand this mistake.
Could aou pleas help and explain.
Thank you.
Best rgs,
Peter
package de.codegym.task.task04.task0428;
/*
Positive Zahl
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int zahl1 = Integer.parseInt(reader.readLine());
int zahl2 = Integer.parseInt(reader.readLine());
int zahl3 = Integer.parseInt(reader.readLine());
int summe;
//zeige die Anzahl positive Zahlen an
if (zahl1 > 0 && zahl1 != 0) {
int x1 =zahl1;
x1 = 0 +1;
}
if (zahl2 > 0 && zahl2 != 0) {
int x2 = zahl2;
x2 = 0 +1;
}
if (zahl3 > 0 && zahl3 != 0) {
int x3 = zahl3;
x3 = 0 +1;
summe = x1 + x2 + x3;
System.out.println(summe);
}
else { System.out.println("0"); }
}
}