結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー zazaboonzazaboon
提出日時 2015-08-09 00:01:55
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 25,076 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 07:22:21
合計ジャッジ時間 743 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,384 KB
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>
int sort(const void*a,const void*b) 
{
	return *(int *)b - *(int *)a;
}
int main (void)
{
	int nyuryoku,nyuryoku_c;
	int i,ketasuu=0,keta[9999],j;
	scanf("%d",&nyuryoku);
	nyuryoku_c = nyuryoku;
	for(i=0;nyuryoku_c!=0;i++)
	{
		nyuryoku_c /= 10;
		ketasuu++;
	};
	for(i=0;i<ketasuu;i++)
	{
		nyuryoku_c = nyuryoku;

		for(j=i;j<ketasuu-1;j++)
		{
			nyuryoku_c/=10;
		}
		keta[i] = nyuryoku_c % 10;
	}
	qsort((void *)keta,ketasuu,sizeof(keta[0]),sort);
	for(i=0;i<ketasuu;i++)
	{
		printf("%d",keta[i]);
	}
	return 0;
}
0