https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWVWgkP6sQ0DFAUO
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for (int t = 1; t <= T; t++) {
String[] words = new String[5];
int maxLen = 0;
for (int i = 0; i < 5; i ++) {
words[i] = br.readLine();
maxLen = Math.max(maxLen, words[i].length());
}
String answer = "";
for (int i = 0; i < maxLen; i++) {
for (int j = 0; j < 5; j++) {
if (i >= words[j].length())
continue;
answer += words[j].charAt(i);
}
}
System.out.println("#" + t + " " + answer);
}
}
}
'Algorithm > 백준+프로그래머스+SWEA+정올+구름' 카테고리의 다른 글
[Algorithm] SWEA 6485 삼성시의 버스 노선 (0) | 2021.08.28 |
---|---|
[Algorithm] SWEA 7964 부먹왕국의 차원 관문 (0) | 2021.08.27 |
[Algorithm] 백준 12927 배수 스위치 (0) | 2021.08.27 |
[Algorithm] SWEA 7236 저수지의 물의 총 깊이 구하기 (0) | 2021.08.26 |
[Algorithm] SWEA 2805 농작물 수확하기 (0) | 2021.08.26 |