結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー NEEHATOVNEEHATOV
提出日時 2020-06-09 02:23:47
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 492 bytes
コンパイル時間 1,193 ms
コンパイル使用メモリ 28,540 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 12:44:04
合計ジャッジ時間 1,483 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0