Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int number = Integer.parseInt(scanner.nextLine());
- int tempNum = 0;
- int charNum = 0;
- for (int i = 0; i <= number; i+=2) {
- tempNum = number % 10;
- charNum = tempNum + 33;
- if (tempNum == 0){
- System.out.print("ZERO");
- }
- for (int j = 0; j < tempNum; j++) {
- System.out.print((char) charNum);
- }
- number /= 10;
- System.out.println();
- i= -1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement