Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std ;
- int main() {
- double rezultat = 1.0;
- for(int i = 2; i <= 10000; i++) {
- if(i % 2 == 0) {
- rezultat -= (1.0 / (double) i);
- }
- else {
- rezultat += (1.0 / (double) i);
- }
- }
- cout << rezultat << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement