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