結果

問題 No.729 文字swap
ユーザー NewbiekunNewbiekun
提出日時 2019-02-20 14:35:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 3,600 ms
コンパイル使用メモリ 75,000 KB
実行使用メモリ 41,648 KB
最終ジャッジ日時 2024-04-24 12:29:34
合計ジャッジ時間 6,137 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
39,568 KB
testcase_01 AC 114 ms
41,040 KB
testcase_02 AC 110 ms
40,876 KB
testcase_03 AC 99 ms
40,296 KB
testcase_04 AC 113 ms
41,268 KB
testcase_05 AC 100 ms
40,020 KB
testcase_06 AC 131 ms
40,924 KB
testcase_07 AC 136 ms
41,252 KB
testcase_08 AC 136 ms
41,648 KB
testcase_09 AC 108 ms
40,680 KB
testcase_10 AC 113 ms
41,136 KB
testcase_11 AC 101 ms
39,720 KB
testcase_12 AC 110 ms
41,136 KB
testcase_13 AC 111 ms
41,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No729
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int i = sc.nextInt();
		int j = sc.nextInt();

		char tmp = s[ i ];
		s[ i ] = s[ j ];
		s[ j ] = tmp;

// char[] sに入っている配列がString型になって返される。
		System.out.println( String.valueOf( s ) );
	}
}
0