結果

問題 No.729 文字swap
ユーザー tenten
提出日時 2020-12-09 18:26:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 73,812 KB
実行使用メモリ 41,684 KB
最終ジャッジ日時 2024-09-19 01:22:05
合計ジャッジ時間 4,043 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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