Jun's Development Journey
[SWEA] 1230. [S/W 문제해결 기본] List - 암호문3 본문
문제
https://www.swexpertacademy.com/main/learn/course/lectureProblemViewer.do
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
www.swexpertacademy.com
풀이
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
public class Solution {
static Scanner scan = new Scanner(System.in);
static int len, num;
static LinkedList<Integer> list = new LinkedList<Integer>();;
static void read_command() {
num = scan.nextInt();
for (int j = 0; j < num; j++) {
int idx, p_num;
switch (op) {
case 'I': {
idx = scan.nextInt();
p_num = scan.nextInt();
for (int k = 0; k < p_num; k++)// 삽입
list.add(idx + k, scan.nextInt());
break;
}
case 'D': {
idx = scan.nextInt();
p_num = scan.nextInt();
for (int k = 0; k < p_num; k++)
break;
}
case 'A': {
p_num = scan.nextInt();
for(int k=0;k<p_num;k++)
list.add(scan.nextInt());
break;
}
}
}
}
static void print_password() {
for (int j = 0; j < 10; j++)
System.out.println();
}
static void solution() {
for (int i = 1; i <= 10; i++) {
len = scan.nextInt();
// 암호문 입력
for (int j = 0; j < len; j++)
list.add(scan.nextInt());
// 명렁어 입력
read_command();
// 10게 출력
System.out.print("#" + i + " ");
print_password();
// 리스트 초기화
list.removeAll(list);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
solution();
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
'SWEA > Intermediate' 카테고리의 다른 글
[SWEA] 1233. [S/W 문제해결 기본] Tree - 사칙연산 유효성 검사 (0) | 2019.08.07 |
---|---|
[SWEA] 1231. [S/W 문제해결 기본] Tree - 중위순회 (0) | 2019.08.06 |
[SWEA] 1229. [S/W 문제해결 기본] List - 암호문2 (0) | 2019.08.06 |
[SWEA] 1228. [S/W 문제해결 기본] List - 암호문1 (0) | 2019.08.06 |
[SWEA] 1227. [S/W 문제해결 기본] Queue - 미로2 (0) | 2019.08.06 |