package shape;
public class MagicSquare {
public static void main(String args[]){
int a[][] = new int[5][5];
int i = 0;
int j = 2;
int k = 1;
while (k <= 25) {
a[i][j] = k;
if (k%5 == 0) {
i = i + 1;
}else{
i = i - 1;
j = j + 1;
if (i < 0) {
i = 4;
}
if(j > 4){
j = 0;
}
}
k++;
}
for (int k2 = 0; k2 < a.length; k2++) {
for (int l = 0; l < a.length; l++) {
System.out.print(a[k2][l]+" ");
}
System.out.println();
}
}
}