結果

問題 No.729 文字swap
ユーザー CroweaCrowea
提出日時 2019-01-19 14:24:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 565 bytes
コンパイル時間 985 ms
コンパイル使用メモリ 61,460 KB
実行使用メモリ 22,812 KB
最終ジャッジ日時 2023-09-23 04:15:53
合計ジャッジ時間 2,528 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,776 KB
testcase_01 AC 55 ms
20,704 KB
testcase_02 AC 55 ms
22,780 KB
testcase_03 AC 55 ms
20,860 KB
testcase_04 AC 55 ms
18,816 KB
testcase_05 AC 55 ms
20,632 KB
testcase_06 AC 55 ms
20,708 KB
testcase_07 AC 56 ms
22,812 KB
testcase_08 AC 56 ms
22,812 KB
testcase_09 AC 56 ms
22,780 KB
testcase_10 AC 55 ms
22,732 KB
testcase_11 AC 55 ms
20,648 KB
testcase_12 AC 55 ms
20,716 KB
testcase_13 AC 55 ms
20,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();
            var idxs = Console.ReadLine().Split(' ');
            var idx_1 = int.Parse(idxs[0]);
            var idx_2 = int.Parse(idxs[1]);
            // SWAP STRING
            var chArr = str.ToCharArray();
            var tmp = chArr[idx_1];
            chArr[idx_1] = chArr[idx_2];
            chArr[idx_2] = tmp;
            str = new string(chArr);
            Console.WriteLine(str);
        }
    }
}
0