結果
問題 |
No.756 チャンパーノウン定数 (1)
|
ユーザー |
![]() |
提出日時 | 2018-12-04 13:59:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 266 bytes |
コンパイル時間 | 593 ms |
コンパイル使用メモリ | 32,000 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-07 05:51:37 |
合計ジャッジ時間 | 1,533 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 RE * 1 |
other | AC * 1 WA * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&d); | ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(){ int i,k=0,d; char str[128]; scanf("%d",&d); for(i=1;k+1>=d;i++){ sprintf(&str[k],"%d",i); k+=floor(log(i)/log(10)); } printf("%d",str[d-1]); return 0; }