Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include <algorithm>
- #include <vector>
- int main()
- {
- double pi = 3.1415926535;
- double P = 1.0;
- for (int i = 1; i <= 9000000; ++i) {
- P *= (double)(((double)i * (double)i * 4.0) / (4.0 * (double)i * (double)i - 1.0));
- }
- cout << "\n";
- cout << P << "\n";
- cout << pi / 2.0 << "\n";
- }
- /*
- $ /c/projects/B.exe line_approx.txt
- line_approx.txt 0.262479 0 0.873039 0
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement