Advertisement
Spocoman

Multiply Table

Sep 8th, 2024
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int num = Integer.parseInt(scanner.nextLine());
  7.  
  8.         for (int i = 1; i <= (num % 10); i++) {
  9.             for (int j = 1; j <= ((num / 10) % 10); j++) {
  10.                 for (int k = 1; k <= (num / 100); k++) {
  11.                     System.out.println(i + " * " + j + " * " + k + " = " + (i * j * k) + ";");
  12.                     // System.out.printf("%d * %d * %d = %d;\n", i, j, k, i * j * k);
  13.                 }
  14.             }
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement