C/C++の宿題を片付けます 93代目 at TECH
[2ch|▼Menu]
735:デフォルトの名無しさん
07/07/23 16:27:02
>>728
#include <iostream>
#include <iomanip>
#include <cmath>

int main()
{
    double s = 0;
    int i, n;
   
    std::cin >> n;
    for(i = 1; i <= n; i++){
        s += pow(-1, i - 1)*1/(2*i - 1);
        std::cout << std::setw(10) << i << " : " << s*4 << std::endl;
    }
   
    return 0;
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5376日前に更新/328 KB
担当:undef