Advertisement
mirozspace

m2

Jan 26th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Pr11MultiplicationTable20 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int n = Integer.parseInt(scanner.nextLine());
  7.         int start = Integer.parseInt(scanner.nextLine());
  8.         int result;
  9.         if (start <= 10) {
  10.             for (int i = start; i <= 10; i++) {
  11.                 result = n * i;
  12.                 System.out.printf("%d X %d = %d%n", n, i, result);
  13.             }
  14.         } else {
  15.             result = n * start;
  16.             System.out.printf("%d X %d = %d%n", n, start, result);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement