It's not the first exercice that i have this mistake it's really anoying because i don't know why. I've tried many things,
I removes all the "{}";
I putt a signle "else" in line 26;
I set line "26" empty;
I wrote "else if (nm>1000 || nm<1);", and let it empty on line 26;
I've tried to set an empty print like this "System.out.println();"
ect... It's not the first time that i have exactly the same error, pleas someone can explain why ?
package fr.codegym.task.task04.task0427;
/*
Description de nombres
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
int nm = Integer.parseInt(sc.readLine());
if(nm%2 == 0 && nm<10){
System.out.println("Nombre pair à un chiffre");
}else if (nm%2 != 0 && nm<10){
System.out.println("Nombre impair à un chiffre");
}else if (nm%2 == 0 && nm<100){
System.out.println("Nombre pair à deux chiffres");
}else if (nm%2 != 0 && nm<100){
System.out.println("Nombre impair à deux chiffres");
}else if (nm%2 == 0 && nm<1000){
System.out.println("Nombre pair à trois chiffres");
}else if (nm%2 != 0 && nm<1000){
System.out.println("Nombre impair à trois chiffres");
}else;
}
}