Advertisement
Ivelin_Arsov

Multiply Table

Feb 23rd, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Problem07 {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int num = Integer.parseInt(scan.nextLine());
  7.  
  8.         String number = num + "";
  9.         char x1 = number.charAt(0);
  10.         char y1 = number.charAt(1);
  11.         char z1 = number.charAt(2);
  12.         int x = Character.getNumericValue(x1);
  13.         int y = Character.getNumericValue(y1);
  14.         int z = Character.getNumericValue(z1);
  15.  
  16.  
  17.         for (int i = 1; i <= z; i++) {
  18.             for (int j = 1; j <= y; j++) {
  19.                 for (int k = 1; k <= x; k++) {
  20.                     int total = i * j * k;
  21.                     System.out.printf("%d * %d * %d = %d;%n", i, j, k, total);
  22.                 }
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement