結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー Maeda
提出日時 2025-03-26 10:36:24
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 25,216 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-26 10:36:26
合計ジャッジ時間 1,546 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:16:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~

ソースコード

diff #

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

void uint2str(char str[], size_t len, int num) {
    snprintf(str, len, "%d", num);
}

void main(void){
    char champernowne[200] = "0.";
    for(int i = 1 ; i <= 55 ; i++){
        char numText[100] = "a";
        uint2str(numText,100,i);
        strcat(champernowne, numText);
    }
    int n = 0;
    scanf("%d",&n);
    printf("%c",champernowne[n+1]);
}
0