공부기록/SWEA

[SWEA] 2027번 대각선 출력하기

메델 2023. 10. 21. 19:34
import java.util.Scanner;
public class Solution {
	
	public static void main(String[] args){
		
		Scanner kb = new Scanner(System.in);
		char[][] arr = new char[5][5];

		for(int i=0; i<5; i++) {
			for(int j=0; j<5; j++) {
				if(i==j) {
					arr[i][j] = '#';
					System.out.print(arr[i][j]);
				}else {
					arr[i][j]= '+';
					System.out.print(arr[i][j]);
				}
			}
			 System.out.println();
		}
		
	}

}

 

 

 

'공부기록 > SWEA' 카테고리의 다른 글

[SWEA] 2047번 신문 헤드라인  (0) 2023.10.21
[SWEA] 14692번 통나무 자르기  (0) 2023.10.21
[SWEA] 1966번 숫자를 정렬하자  (0) 2023.10.20
[SWEA] 2072번 홀수만 더하기  (0) 2023.10.20
[SWEA] 1204번 최빈수 구하기  (0) 2023.10.20