Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main()
- {
- int cnt = 0;
- int x, y, z;
- ifstream in("input.txt");
- ofstream out("output.txt");
- while (in.peek() != EOF)
- {
- int t;
- in >> t;
- cnt++;
- if (cnt == 1)
- x = t;
- if (cnt == 2)
- y = t;
- if (cnt == 3)
- {
- z = t;
- cnt = 0;
- if (x % 2 == y % 2 && x % 2== z % 2)
- out << x << " " << y << " " << z << endl;
- }
- }
- in.close();
- out.close();
- }
Add Comment
Please, Sign In to add comment