My code gives right answer for even 2& 3 digit number, still it is not passing the test
package com.codegym.task.task04.task0427;
/*
Describing numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
String s = buff.readLine();
int n = Integer.parseInt(s);
int n1 = n;
int count = 0;
while((n > 0) && (n < 1000))
{
n1 = n % 10;
n = n/10;
count = count + 1;
//System.out.println(n1);
}
if (n1 % 2 == 0)
s = "even";
//System.out.println(s);}
else
s = "odd";
switch(count){
case 1: System.out.printf("%s single-digit number\n", s);
break;
case 2: System.out.printf("%s two-digit number\n", s);
break;
case 3: System.out.printf("%s three-digit number\n", s);
break;
}
}
}