[ create a new paste ] login | about

Link: http://codepad.org/V42Rq8lh    [ raw code | output | fork ]

Lol4t0 - C++, pasted on Dec 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
 using namespace std;
int main()
{
        double fac=1.0;
        int n;
        cout<<"Введите n или что то там"<<endl;
        cin>>n;
        n = 10000;

        for(int i=1;i<=n;i++)
        {
                fac*=(1+1.0/(i*i));
        }
        cout<<"Результат равен "<<fac<<endl;
        printf("%2.f \n",fac);
        return 0;
}


Output:
1
2
3
Введите n или что то там
Результат равен 3.67571
 4 


Create a new paste based on this one


Comments: