import java.util.Scanner;
class Main {
public static void main(String[] args) {
int digit;
String digitString;
Scanner sc = new Scanner(System.in);
digit = sc.nextInt();
switch (digit) {
case 1: digitString = "one";
break;
case 2: digitString = "two";
break;
case 3: digitString = "three";
break;
case 4: digitString = "four";
break;
case 5: digitString = "five";
break;
case 6: digitString = "six";
break;
case 7: digitString = "seven";
break;
case 8: digitString = "eight";
break;
case 9: digitString = "nine";
break;
default:digitString="invalid digit";
break;
}
System.out.println(digitString);
}
}
class Main {
public static void main(String[] args) {
int digit;
String digitString;
Scanner sc = new Scanner(System.in);
digit = sc.nextInt();
switch (digit) {
case 1: digitString = "one";
break;
case 2: digitString = "two";
break;
case 3: digitString = "three";
break;
case 4: digitString = "four";
break;
case 5: digitString = "five";
break;
case 6: digitString = "six";
break;
case 7: digitString = "seven";
break;
case 8: digitString = "eight";
break;
case 9: digitString = "nine";
break;
default:digitString="invalid digit";
break;
}
System.out.println(digitString);
}
}
Комментариев нет:
Отправить комментарий