입력받은 숫자 n에 대해 1씩 커지는 n x n 사각형 만들기
package _2;
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int count = 1;
int[][] squre = new int[n][n];
for(int i=0; i<n; i++)
{
for(int j=0; j<n ; j++)
{
squre[i][j] =count;
System.out.print(squre[i][j]+" ");
count++;
}
System.out.println();
}
}
}