๋ฐ์ํ
https://www.acmicpc.net/problem/11945
์ฝ๋
import java.io.*;
public class Main {
public static void main (String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String str1[] = br.readLine().split(" ");
int N = Integer.parseInt(str1[0]);
int M = Integer.parseInt(str1[1]);
for (int i = 0; i < N; i++) {
String str = br.readLine();
for (int j = 0; j < M; j++) {
bw.write(str.charAt(M - j - 1));
}
bw.write("\n");
}
bw.flush();
}
}
ํ์ด
๋ฌธ์ ๊ทธ๋๋ก ๋ค์ง์ด์ ์ถ๋ ฅํ๋ฉด ๋๋๋ฐ,,
bw.write(str.charAt(M - j - 1));
์ด์ํ๊ฒ StringBuilder๋ฅผ ์ฌ์ฉํด์ ์ถ๋ ฅํ๋ฉด ๋ฐํ์์ด ๋ฐ์ํ๋ค.
๊ทธ๋์ Buffered๋ฅผ ํตํด ์ถ๋ ฅ์ ํ๋๋ ์ ์ถ๋๋ค .
๋ฐ์ํ
'Algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)ํ (0) | 2020.03.16 |
---|---|
[Codeforces] 1303A: Erasing Zeroes (0) | 2020.03.16 |
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)๋ค๋ฆฌ๋ฅผ ์ง๋๋ ํธ๋ญ (0) | 2020.03.13 |
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)์ต์๊ฐ ๋ง๋ค๊ธฐ (0) | 2020.03.13 |
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)N๊ฐ์ ์ต์๊ณต๋ฐฐ์ (0) | 2020.03.13 |
๋๊ธ