結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー RabbitCPRabbitCP
提出日時 2015-08-08 21:12:20
言語 D
(dmd 2.106.1)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 631 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,832 KB
最終ジャッジ日時 2024-04-27 02:09:16
合計ジャッジ時間 570 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
Main.d(28): Deprecation: foreach: loop index implicitly converted from `size_t` to `int`
Main.d(32): Error: no property `sort` for type `uint[]`, perhaps `import std.algorithm;` is needed?

ソースコード

diff #

/*****************************
 Name         : Yoshitak
 Create Date  : 2015/06/05
 Program Name : main.d
 Problem No.  : 256
*****************************/

/*---------------------
 import
-----------------------*/
import std.stdio;
import std.string;
import std.conv;
import std.array;

/*---------------------
 main
-----------------------*/
int main(string[] args)
{
	//input
	uint[] num;
	string input;
	input = chomp(readln());
	
	//into the arry
	num.length = input.length;
	foreach(int i, char c; input){
		num[i] = to!int(c);
	}

  num.sort;
  
	//output
	foreach_reverse(int c; num){
		write(to!char(c));
	}

	return 0;
}
0