artemgf

Точки домино

Mar 19th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4. #include <string>
  5. #include <algorithm>
  6. #include <set>
  7.  
  8. using namespace ::std;
  9.  
  10. int main()
  11. {
  12.     long long intellect, sum;
  13.  
  14.     cin >> intellect;
  15.     if (intellect % 2 == 0)
  16.         sum = (intellect + 1)*(intellect / 2);
  17.     else
  18.         sum = ((intellect + 1)*(intellect / 2) + intellect / 2 + 1);
  19.     sum = sum*(intellect + 2);
  20.  
  21.     cout << sum;
  22.  
  23.     _getch();
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment