Lyubohd

Coding

Feb 19th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Demo {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String  n = scanner.nextLine();
  8.  
  9.         for (int i = n.length() - 1; i >= 0; i--) {
  10.             int number = Integer.parseInt("" + n.charAt(i));
  11.             int numberInAscii = number + 33;
  12.             if (number == 0) {
  13.                 System.out.println("ZERO");
  14.             } else {
  15.                 for (int j = 0; j < number; j++) {
  16.                     System.out.print((char) numberInAscii);
  17.                 }
  18.                 System.out.println();
  19.             }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment