結果
問題 |
No.454 逆2乗和
|
ユーザー |
![]() |
提出日時 | 2016-12-07 16:58:06 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 79 ms |
コンパイル使用メモリ | 21,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-28 03:23:21 |
合計ジャッジ時間 | 960 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | WA * 31 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:13: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double *’ [-Wformat=] 9 | scanf("%f",&x); | ~^ ~~ | | | | | double * | float * | %lf main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%f",&x); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ double a=1.6449340668482426; double x; int y; int i; scanf("%f",&x); y=x; for(i=1; i<=y; i++){ a-= 1/ (i*i); } if(x-y>0){ a-= 1/ (x*x); } printf("%.15f\n",a); return 0; }