結果

問題 No.729 文字swap
ユーザー tentententen
提出日時 2020-12-09 18:26:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 73,944 KB
実行使用メモリ 57,628 KB
最終ジャッジ日時 2023-10-19 05:05:08
合計ジャッジ時間 4,883 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
57,404 KB
testcase_01 AC 136 ms
57,400 KB
testcase_02 AC 138 ms
57,152 KB
testcase_03 AC 136 ms
57,624 KB
testcase_04 AC 136 ms
57,140 KB
testcase_05 AC 137 ms
57,444 KB
testcase_06 AC 136 ms
57,432 KB
testcase_07 AC 134 ms
57,552 KB
testcase_08 AC 137 ms
57,628 KB
testcase_09 AC 133 ms
57,428 KB
testcase_10 AC 136 ms
57,560 KB
testcase_11 AC 137 ms
57,620 KB
testcase_12 AC 136 ms
57,376 KB
testcase_13 AC 136 ms
57,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] arr = sc.next().toCharArray();
        int i = sc.nextInt();
        int j = sc.nextInt();
        char tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
        System.out.println(arr);
    }
}
0