Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MultiplyTable {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- int first = n%10;
- int second = n/10%10;
- int third = n/100;
- for (int x1 = 1; x1 <=first ; x1++) {
- for (int x2 = 1; x2 <=second ; x2++) {
- for (int x3 = 1; x3 <= third; x3++) {
- int sum = x1*x2*x3;
- System.out.printf("%d * %d * %d = %d;%n", x1,x2, x3, sum);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement