blob: b22549e312a6f40d6c0c281d07aaa8fed6fdeb5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <fstream>
#include <iostream>
#include <vector>
int main() {
std::vector<int> ns;
while (!std::cin.eof() || std::cin) {
int n;
std::cin >> n;
ns.push_back(n);
}
if (!std::cin.eof()) {
std::cerr << "Failed to parse input.\n";
return -1;
}
if (ns.size() % 2 != 0) {
std::cerr << "Input integer number must be even.\n";
return -1;
}
}
|