-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_2675.java
More file actions
41 lines (34 loc) · 828 Bytes
/
_2675.java
File metadata and controls
41 lines (34 loc) · 828 Bytes
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
package backjoon;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// https://www.acmicpc.net/problem/2675
// 문자열 반복
public class _2675 {
public static void main(String[] args) throws IOException {
//memory 11536 runtime 96
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int i = 0; i < T; i++) {
String[] str = br.readLine().split(" ");
// String to int
int R = Integer.parseInt(str[0]);
String S = str[1];
for(int j = 0; j < S.length(); j++) {
for(int k = 0; k < R; k++) {
System.out.print(S.charAt(j));
}
}
System.out.println();
}
}
}
/*
input
2
3 ABC
5 /HTP
output
AAABBBCCC
/////HHHHHTTTTTPPPPP
*/