結果

問題 No.428 小数から逃げる夢
コンテスト
ユーザー kobaryo222
提出日時 2016-10-02 23:21:24
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 364 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 226 ms
コンパイル使用メモリ 28,740 KB
最終ジャッジ日時 2026-02-23 22:26:33
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 100
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:15: warning: format ‘%g’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=]
    8 |     printf("%#gLf", answer);
      |             ~~^     ~~~~~~
      |               |     |
      |               |     long double
      |               double
      |             %#Lg
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%Lf", &N);
      |     ^~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

int main(){
    long double D = 0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991q;
    long double N;
    scanf("%Lf", &N);
    long double answer = D * N;
    printf("%#gLf", answer);
    return 0;
}
0