結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー NoNo
提出日時 2017-08-02 21:39:42
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,637 bytes
コンパイル時間 2,600 ms
コンパイル使用メモリ 113,112 KB
実行使用メモリ 54,472 KB
最終ジャッジ日時 2024-04-19 20:42:31
合計ジャッジ時間 6,265 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,680 KB
testcase_01 AC 21 ms
18,304 KB
testcase_02 TLE -
testcase_03 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string n = Console.ReadLine();
            string a = "";
            int cnt = n.Count(x => x == '9');
            for (int i = 0; i < cnt; i++)
            {
                a += "9";
            }

            cnt = n.Count(x => x == '8');
            for (int i = 0; i < cnt; i++)
            {
                a += "8";
            }

            cnt = n.Count(x => x == '7');
            for (int i = 0; i < cnt; i++)
            {
                a += "7";
            }

            cnt = n.Count(x => x == '6');
            for (int i = 0; i < cnt; i++)
            {
                a += "6";
            }

            cnt = n.Count(x => x == '5');
            for (int i = 0; i < cnt; i++)
            {
                a += "5";
            }

            cnt = n.Count(x => x == '4');
            for (int i = 0; i < cnt; i++)
            {
                a += "4";
            }

            cnt = n.Count(x => x == '3');
            for (int i = 0; i < cnt; i++)
            {
                a += "3";
            }

            cnt = n.Count(x => x == '2');
            for (int i = 0; i < cnt; i++)
            {
                a += "2";
            }

            cnt = n.Count(x => x == '1');
            for (int i = 0; i < cnt; i++)
            {
                a += "1";
            }

            cnt = n.Count(x => x == '0');
            for (int i = 0; i < cnt; i++)
            {
                a += "0";
            }

            Console.WriteLine(a);
        }
    }
}
0