-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ2675.java
More file actions
36 lines (33 loc) · 1.08 KB
/
Q2675.java
File metadata and controls
36 lines (33 loc) · 1.08 KB
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
/**
* Date: 2018. 10. 5.
* Author: inhyuck | https://github.com/inhyuck
* Solution URL: https://github.com/inhyuck/algorithm
* Title: 문자열 반복
* description: 입력 받고 반복문자열 출력
* Problem URL: https://www.acmicpc.net/problem/2675
*/
package io.inhyuck.io;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;
public class Q2675 {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
int t = scanner.nextInt();
int repeatNumber;
String input;
while (t-- > 0) {
repeatNumber = scanner.nextInt();
input = scanner.nextLine().trim();
for (int i = 0; i < input.length(); i++) {
for (int j = 0; j < repeatNumber; j++) {
writer.write(input.charAt(i));
}
}
writer.write("\n");
}
writer.flush();
}
}