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 scan = new Scanner(System.in);
- int number = Integer.parseInt(scan.nextLine());
- int firstDigit = number % 10;
- int secondDigit = (number / 10) % 10;
- int thirdDigit = number / 100;
- for (int first = 1; first <= firstDigit ; first++) {
- for (int second = 1; second <= secondDigit ; second++) {
- for (int third = 1; third <= thirdDigit ; third++) {
- System.out.printf("%d * %d * %d = %d;%n", first, second, third, (first * second * third));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement