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