Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Exam;
- import java.util.Scanner;
- public class MultiplicationTable {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int number = Integer.parseInt(scan.nextLine());
- int lastNum = number % 10;
- int middleNum = number / 10 % 10;
- int firstNum = number / 100;
- for (int i = 1; i <= lastNum; i++) {
- for (int j = 1; j <= middleNum; j++) {
- for (int k = 1; k <= firstNum; k++) {
- System.out.printf("%d * %d * %d = %d;\n", i, j, k, i * j * k);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment