public static void main(String[] args) {
int count = 1;
int[][] a = new int[5][5];
for(int i = 0;i<a.length;i++) {
if(i%2 == 0) { //증가
for(int j = 0;j<a[i].length;j++) {
a[i][j] = count++;
}
}
else { // 감소
for(int j = a[i].length-1;j>=0;j--) {
a[i][j] = count++;
}
}
}
for(int i = 0;i<a.length;i++) {
for(int j = 0;j<a[i].length;j++) {
System.out.print(a[i][j]+"\t");
}
System.out.println();
}
}