Advertisement
Azazavr

Таблица умножения

Feb 21st, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. public class TablicaUmnozeniya {
  2.  
  3.     public static void main(String[] args) {
  4.         for (int i = 1; i < 10; i++) {
  5.             if (i == 1){
  6.                 System.out.println("*|   1   2   3   4   5   6   7   8   9");
  7.                 System.out.println("--------------------------------------");
  8.             }
  9.             else
  10.                 System.out.println(" ");
  11.             for (int j = 1; j < 10; j++) {
  12.                 if (j==1) {
  13.                     System.out.print(i);
  14.                     System.out.print("|");
  15.                 }
  16.                 System.out.printf(" %3d", i*j);
  17.             }
  18.  
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement