結果
問題 |
No.256 桁の数字を入れ替え (2)
|
ユーザー |
![]() |
提出日時 | 2020-06-09 02:23:47 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 492 bytes |
コンパイル時間 | 1,416 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-29 11:54:39 |
合計ジャッジ時間 | 2,324 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 2 |
ソースコード
#include <stdio.h> #include <string.h> #include <stdlib.h> int desc(const void* a, const void* b) { return *(int*)b - *(int*)a; } int main() { int i, L, N[10000]; char s[10000], strDest2[32]; scanf("%s", &s,10000); L = strlen(s); for (i = 0; i < L; i++) { strncpy(strDest2, s+i, 1); N[i] = atoi(strDest2); } qsort(N, L, sizeof(int), desc); for (i = 0; i < L; i++) { printf("%d", N[i]); } printf("\0"); return 0; }