SWEA
[SWEA] 대각선 출력하기
itsnot4me
2024. 9. 19. 19:26
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
for(int test_case = 1; test_case <= 5; test_case++)
{
for ( int i = 1; i <=5; i++){
if(i==test_case) System.out.print("#");
else System.out.print("+");
}
System.out.println();
}
}
}
그냥 print 해도 되겠지만, 뭐라도 해보라는 뜻 아닐까