YavorGrancharov

NumbersAsWords

Dec 15th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class NumbersAsWords {
  3.     public static void main(String[] args) {
  4.         Scanner console = new Scanner(System.in);
  5.         int i = Integer.parseInt(console.nextLine());
  6.         if (i == 0) {
  7.             System.out.println("zero");
  8.         }
  9.         else if (i == 1) {
  10.             System.out.println("one");
  11.         }
  12.         else if (i == 2) {
  13.             System.out.println("two");
  14.         }
  15.         else if (i == 3) {
  16.             System.out.println("three");
  17.         }
  18.         else if (i == 4) {
  19.             System.out.println("four");
  20.         }
  21.         else if (i == 5) {
  22.             System.out.println("five");
  23.         }
  24.         else if (i == 6) {
  25.             System.out.println("six");
  26.         }
  27.         else if (i == 7) {
  28.             System.out.println("seven");
  29.         }
  30.         else if (i == 8) {
  31.             System.out.println("eight");
  32.         }
  33.         else if (i == 9) {
  34.             System.out.println("nine");
  35.         } else {
  36.             System.out.println("number too big");
  37.         }
  38.  
  39.     }
  40. }
Add Comment
Please, Sign In to add comment