Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("bac.txt");
- int main() {
- int r1 = -1, r2 = -1;
- for (int x; fin >> x;) {
- if (x & 1) {
- if (r1 == -1) {
- r1 = x;
- } else if (r2 == -1) {
- r2 = x;
- } else {
- r1 = r2;
- r2 = x;
- }
- }
- }
- cout << r1 << ' ' << r2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement