Advertisement
marking2112

NLCoding

Oct 23rd, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 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.         int number = Integer.parseInt(scanner.nextLine());
  8.         int tempNum = 0;
  9.         int charNum = 0;
  10.  
  11.         for (int i = 0; i <= number; i+=2) {
  12.             tempNum = number % 10;
  13.             charNum = tempNum + 33;
  14.  
  15.             if (tempNum == 0){
  16.                 System.out.print("ZERO");
  17.             }
  18.  
  19.             for (int j = 0; j < tempNum; j++) {
  20.                 System.out.print((char) charNum);
  21.             }
  22.             number /= 10;
  23.             System.out.println();
  24.             i= -1;
  25.         }
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement