day06_FlowEx21

육희영·2021년 9월 13일
0

배열의 위치에 맞게 출력하기

package day06;

public class FlowEx21 {

	public static void main(String[] args) {
		for(int i=1; i<=5; i++){
			for(int j=1; j<=5; j++){
				if(i == j) {
					System.out.printf("[%d,%d]", i, j);
				} else {
					System.out.printf("%5c", ' ');
				}			
			}System.out.println();
		} //for End
	} //main End

} //class End

출력결과

0개의 댓글

관련 채용 정보