Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Homework8 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- switch (input) {
- case "0":
- System.out.printf("zero");
- break;
- case "1":
- System.out.printf("one");
- break;
- case "2":
- System.out.printf("two");
- break;
- case "3":
- System.out.printf("three");
- break;
- case "4":
- System.out.printf("four");
- break;
- case "5":
- System.out.printf("five");
- break;
- case "6":
- System.out.printf("six");
- break;
- case "7":
- System.out.printf("seveb");
- break;
- case "8":
- System.out.printf("eight");
- break;
- case "9":
- System.out.printf("nine");
- break;
- default:
- System.out.printf("not a digit");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement