Advertisement
tchenkov

L03u05v2_NumberToText

Jan 18th, 2017
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * Created by todor on 17.01.2017 г..
  5.  */
  6. public class u05v2_NumberToText {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int num = Integer.parseInt(scan.nextLine());
  12.  
  13.         switch (num) {
  14.             case 0:
  15.                 System.out.println("zero");
  16.                 break;
  17.             case 1:
  18.                 System.out.println("one");
  19.                 break;
  20.             case 2:
  21.                 System.out.println("two");
  22.                 break;
  23.             case 3:
  24.                 System.out.println("three");
  25.                 break;
  26.             case 4:
  27.                 System.out.println("four");
  28.                 break;
  29.             case 5:
  30.                 System.out.println("five");
  31.                 break;
  32.             case 6:
  33.                 System.out.println("six");
  34.                 break;
  35.             case 7:
  36.                 System.out.println("seven");
  37.                 break;
  38.             case 8:
  39.                 System.out.println("eight");
  40.                 break;
  41.             case 9:
  42.                 System.out.println("nine");
  43.                 break;
  44.             default:
  45.                 System.out.println("number too big");
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement