Advertisement
Guest User

dfsdfsd

a guest
Oct 30th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class P2Multiplikationstabelle {
  2.     public static void main(String[] args) {
  3.         final int n = 5;
  4.         for (int i = 0; i <= n; i++) {
  5.             for (int j = 1; j <= n; j++) {
  6.                 if (j == 1) {
  7.                     if (i != 0) {
  8.                         System.out.print(i);
  9.                     }
  10.                     System.out.print("\t ");
  11.                 }
  12.                 if (i == 0) {
  13.                     System.out.print ((i+1)*j + "\t ");
  14.                 } else {
  15.                     System.out.print (i*j + "\t ");
  16.                 }
  17.             }
  18.             System.out.println();
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement