Advertisement
Guest User

alala

a guest
May 26th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package SimpleConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class demo {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. int a = Integer.parseInt(scanner.nextLine());
  9.  
  10. if (a > 9)
  11. System.out.println("number too big");
  12. else if (a == 1)
  13. System.out.println("one");
  14. else if (a == 2)
  15. System.out.println("two");
  16. else if (a == 3)
  17. System.out.println("three");
  18. else if (a == 4)
  19. System.out.println("four");
  20. else if (a == 5)
  21. System.out.println("five");
  22. else if (a == 6)
  23. System.out.println("six");
  24. else if (a == 7)
  25. System.out.println("seven");
  26. else if (a == 8)
  27. System.out.println("eight");
  28. else if (a == 9)
  29. System.out.println("nine");
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement