Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- 이분탐색
- math
- SWEA
- SQL
- 프로그래머스
- 코테
- greedy
- priorityqueue
- MySQL
- COS PRO
- 건강
- BFS
- dfs
- 러닝일지
- BOJ
- binary search
- 문제풀이
- Java
- 코딩테스트
- 문자열
- 시뮬레이션
- 백준
- 운동기록
- oracle
- 투포인터
- 알고리즘
- 자바
- db
- 문제해결
- DP
Archives
- Today
- Total
슈콩
[SWEA] 의석이의 세로로 말해요 본문


[문제]
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWVWgkP6sQ0DFAUO
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
[소스 코드]
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int tc=1;tc<=T;tc++) {
String[] str = new String[5];
int max = 0;
for(int i=0;i<5;i++) {
str[i] = br.readLine();
max = Math.max(max, str[i].length());
}
char[][] map = new char[5][max];
for(int i=0;i<5;i++) {
for(int j=0;j<str[i].length();j++) {
map[i][j] = str[i].charAt(j);
}
}
String result = "";
for(int i=0;i<max;i++) {
for(int j=0;j<5;j++) {
if(i<str[j].length())
result += map[j][i];
}
}
System.out.println("#"+tc+" "+result);
}
}
}'Algorithms > SWEA' 카테고리의 다른 글
| [SWEA] 준홍이의 카드놀이 (0) | 2025.11.17 |
|---|---|
| [SWEA] 모음이 보이지 않는 사람 (0) | 2025.11.17 |
| [SWEA] 제곱 팰린드롬 수 (0) | 2025.11.16 |
| [SWEA] 24시간 (0) | 2025.11.16 |
| [SWEA] 외로운 문자 (0) | 2025.11.16 |