結果

問題 No.400 鏡
ユーザー yagi2yagi2
提出日時 2017-04-17 11:20:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 3,567 ms
コンパイル使用メモリ 72,880 KB
実行使用メモリ 56,004 KB
最終ジャッジ日時 2023-09-26 10:32:46
合計ジャッジ時間 4,412 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,552 KB
testcase_01 AC 119 ms
55,824 KB
testcase_02 AC 120 ms
55,280 KB
testcase_03 AC 119 ms
55,684 KB
testcase_04 AC 119 ms
55,868 KB
testcase_05 AC 118 ms
55,392 KB
testcase_06 AC 119 ms
55,472 KB
testcase_07 AC 118 ms
53,632 KB
testcase_08 AC 117 ms
55,716 KB
testcase_09 AC 119 ms
55,744 KB
testcase_10 AC 118 ms
55,932 KB
testcase_11 AC 118 ms
56,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        StringBuffer S = new StringBuffer(sc.next());
        S.reverse();

        StringBuilder ans = new StringBuilder();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '>') ans.append("<");
            if (S.charAt(i) == '<') ans.append(">");
        }

        System.out.println(ans);
    }
}
0