-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBj2675.java
More file actions
36 lines (27 loc) · 985 Bytes
/
Bj2675.java
File metadata and controls
36 lines (27 loc) · 985 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
package string;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Bj2675 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for (int i = 0; i < T; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
String text = st.nextToken();
StringBuilder sb = new StringBuilder();
if (text != null) {
for (int j = 0; j < text.length(); j++) {
char ch = text.charAt(j);
for (int k = 0; k < n; k++) {
sb.append(ch);
}
}
System.out.println(sb.toString());
}
}
br.close();
}
}