반응형
너무 빨리 풀어서 깜짝 놀랐다.
BufferedWriter클래스를 사용하지 않은 코드와 사용한 코드.
/*
* Author : Jeonghun Cho
* Date : December 6, 2019
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int size = Integer.parseInt(br.readLine());
String[] input = new String[size];
for(int i=0; i<size; i++) {
input = br.readLine().split(" ");
for(int j=0; j<input[1].length(); j++) {
char ch = input[1].charAt(j);
for(int k=0; k<Integer.parseInt(input[0]); k++) {
System.out.print(ch);
}
}
System.out.println();
}
}
}
Colored by Color Scripter
|
/*
* Author : Jeonghun Cho
* Date : December 6, 2019
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int size = Integer.parseInt(br.readLine());
String[] input = new String[size];
for(int i=0; i<size; i++) {
input = br.readLine().split(" ");
for(int j=0; j<input[1].length(); j++) {
char ch = input[1].charAt(j);
for(int k=0; k<Integer.parseInt(input[0]); k++) {
}
}
bw.write("\n");
}
}
}
Colored by Color Scripter
|
반응형
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 2523 별찍기 - 13 (C언어) (0) | 2020.03.18 |
---|---|
[백준] 5543 상근날드 (C언어) (0) | 2020.03.17 |
[백준] 1152 단어의 개수 (Java) (0) | 2019.12.06 |
[백준] 2908 상수 (Java, C언어) (0) | 2019.12.05 |
[백준] 5622 다이얼 (Java) (0) | 2019.12.05 |