結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー Himatsubushin
提出日時 2024-12-24 10:13:21
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 29,056 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-24 10:13:23
合計ジャッジ時間 1,117 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 2 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>

#define MAX 6

int main(void) {
	char n[MAX + 1];
	int bit, temp;

	printf("n = ");
	scanf("%s", n);

	bit = strlen(n);

	for (int i = 0; i < bit - 1; i++)
		for (int j = i + 1; j < bit; j++)
			if (n[i] < n[j])
				temp = n[i], n[i] = n[j], n[j] = temp;

	printf("%s\n", n);

	return 0;
}
0