結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー swdamdr
提出日時 2017-02-27 13:41:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 963 ms
コンパイル使用メモリ 106,416 KB
実行使用メモリ 27,644 KB
最終ジャッジ日時 2024-06-11 19:21:21
合計ジャッジ時間 1,690 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        char[] c = s.ToCharArray();
        Array.Sort(c);
        Array.Reverse(c);

        s = s.Replace(c[0].ToString(), "");
        s = s.Replace(c[1].ToString(), "");

        Console.WriteLine(c[0].ToString() + c[1].ToString() + s);
        Console.Read();
    }
}
0