Advertisement
cyberjab

Untitled

Nov 29th, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <string>
  6. #include <vector>
  7. #include <set>
  8.  
  9. using namespace std;
  10.  
  11. int summa(int x) {
  12.     int sm = 0;
  13.     for (int i = x; i < 3 * x; i++) {
  14.         sm += i - 2;
  15.     }
  16.     return sm;
  17. }
  18.  
  19. int main() {
  20.     int k = 2;
  21.     int ans = 1;
  22.     for (int i = 2; i < 6; i++) {
  23.         ans *= summa(k);
  24.         k++;
  25.     }
  26.     cout << ans;
  27.     return 0;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement