Advertisement
borkins

05a. Number 0..9 to Text

Mar 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. /*
  2.  * Simple Conditions
  3.  */
  4. import java.util.Scanner;
  5.  
  6. public class _05a_Number_0_9_toText
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner scan = new Scanner(System.in);
  11.  
  12.         int num = Integer.parseInt(scan.nextLine());
  13.  
  14.         if (num == 0) {
  15.             System.out.println("zero");
  16.         } else if (num == 1) {
  17.             System.out.println("one");
  18.         } else if (num == 2) {
  19.             System.out.println("two");
  20.         } else if (num == 3) {
  21.             System.out.println("three");
  22.         } else if (num == 4) {
  23.             System.out.println("four");
  24.         } else if (num == 5) {
  25.             System.out.println("five");
  26.         } else if (num == 6) {
  27.             System.out.println("six");
  28.         } else if (num == 7) {
  29.             System.out.println("seven");
  30.         } else if (num == 8) {
  31.             System.out.println("eight");
  32.         } else {
  33.             System.out.println("nine");
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement