Advertisement
filashkov

Untitled

Feb 29th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, d = 0;
  8.     cin >> n;
  9.     if (n % 2 == 1)
  10.     {
  11.         cout << 0 << endl;
  12.         return 0;
  13.     }
  14.     n /= 2;
  15.     for (int i = 0; i < n; i++)
  16.     {
  17.         int a, b;
  18.         cin >> a >> b;
  19.         d += a * b;
  20.     }
  21.     cout << d << endl;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement