結果

問題 No.454 逆2乗和
ユーザー ndifix
提出日時 2016-12-07 16:49:44
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 03:23:17
合計ジャッジ時間 1,076 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d",&x);
      |     ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
    double a=0;
    int x;
    int i;
    
    scanf("%d",&x);
    for(i=1; i<=x; i++){
        a+= 1/ (i*i);
    }
    
    a= 1.6449340668482426 -a;
    printf("%.9f\n",a);
    
    return 0;
}
0