結果

問題 No.729 文字swap
ユーザー kohaku_kohaku
提出日時 2019-02-19 18:10:56
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 2,115 ms
コンパイル使用メモリ 74,480 KB
実行使用メモリ 54,380 KB
最終ジャッジ日時 2024-10-12 12:57:13
合計ジャッジ時間 4,808 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int i = sc.nextInt();
        int j = sc.nextInt();
        System.out.println(exchange(s,i,j));
    }
    
    static String exchange(String s, int i, int j) {
        char [] arr = s.toCharArray();
        char tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
        return arr.toString();
    }
}
0