Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main() {
  8.     function<double()> f = []() {
  9.         double sum = 0;
  10.         for (int i = 1; i <= 10; i++)
  11.             sum += static_cast<double>(1) / (i * i + 1);
  12.         return sum;
  13.     };
  14.     cout << f();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement