daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.         int [][] arr = new int[4][4];
  5.         int k = 8;
  6.  
  7.         for (int i = 1; i <= 8; i++)
  8.         {
  9.             if (i <= 4)
  10.             {
  11.                 arr[0][i - 1] = i;
  12.                 arr[2][i - 1] = k;
  13.             }
  14.             else
  15.             {
  16.                 arr[1][i - 5] = i;
  17.                 arr[3][i - 5] = k;
  18.             }
  19.  
  20.             k--;
  21.  
  22.         }
  23.  
  24.         for (int n = 0; n < 4; n++) {
  25.             for (int m = 0; m < 4; m++) {
  26.                 System.out.print(arr[n][m] + " " );
  27.             }
  28.             System.out.println();
  29.         }
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top