Advertisement
desislava_topuzakova

05.Numbers from 0 to 9

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