Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- freopen("bac.txt", "r", stdin);
- int x, a, b, ans1 = -1, ans2 = -1;
- cin >> x >> a;
- while (cin >> b) {
- if (a % 1000 == x && b % 1000 == x) {
- ans1 = a;
- ans2 = b;
- }
- a = b;
- }
- if (ans1 == -1) {
- cout << "nu exista" << endl;
- } else {
- cout << ans1 << ' ' << ans2 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement