Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MultiplyTable {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int n = Integer.parseInt(scanner.nextLine());
  7.  
  8.         int first = n%10;
  9.         int second = n/10%10;
  10.         int third = n/100;
  11.         for (int x1 = 1; x1 <=first ; x1++) {
  12.             for (int x2 = 1; x2 <=second ; x2++) {
  13.                 for (int x3 = 1; x3 <= third; x3++) {
  14.                     int sum = x1*x2*x3;
  15.                     System.out.printf("%d * %d * %d = %d;%n", x1,x2, x3, sum);
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement