Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* package whatever; // don't place package name! */
- import java.util.*;
- import java.lang.*;
- import java.io.*;
- /* Name of the class has to be "Main" only if the class is public. */
- class integer
- {
- public integer(int value) {
- this.value = value;
- }
- public int value;
- }
- class Ideone
- {
- public static void main (String[] args) throws java.lang.Exception
- {
- int lim = 9;
- integer[][] a = new integer[lim][lim];
- for (int i = 0; i < lim; i++) {
- for (int j = 0; j < lim; j++) {
- if (j <= i) a[i][j] = new integer(j + 1);
- else a[i][j] = null;
- }
- }
- for (int i = 0; i < lim; i++) {
- for (int j = 0; j < lim; j++)
- if (j <= i) System.out.print(a[i][j].value + " ");
- else System.out.print(0 + " ");
- System.out.print('\n');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement