結果

問題 No.400 鏡
ユーザー jimanojimano
提出日時 2018-01-20 12:52:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 2,609 ms
コンパイル使用メモリ 71,948 KB
実行使用メモリ 49,520 KB
最終ジャッジ日時 2023-08-26 08:48:05
合計ジャッジ時間 3,778 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
49,232 KB
testcase_01 AC 38 ms
49,096 KB
testcase_02 AC 38 ms
49,372 KB
testcase_03 AC 38 ms
49,248 KB
testcase_04 AC 38 ms
49,192 KB
testcase_05 AC 39 ms
49,220 KB
testcase_06 AC 38 ms
48,996 KB
testcase_07 AC 39 ms
49,304 KB
testcase_08 AC 39 ms
49,120 KB
testcase_09 AC 40 ms
49,140 KB
testcase_10 AC 39 ms
49,224 KB
testcase_11 AC 38 ms
49,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0400 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			char[] array = br.readLine().toCharArray();
			int length = array.length;
			char tmp;

			// change
			for (int i = 0; i < length / 2; i++) {
				int idx = length - 1 - i;
				tmp = array[i];
				array[i] = array[idx];
				array[idx] = tmp;
			}
			// reverse
			for (int i = 0; i < length; i++) {
				array[i] = (array[i] == '>') ? '<' : '>';
			}

			System.out.println(array);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0