Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("bac.in");
- bool isInFile[100];
- int out[2];
- int main() {
- for (int x; fin >> x;) {
- if (x < 100) {
- isInFile[x] = true;
- }
- }
- int written = 0;
- for (int a = 9; a; a--) {
- for (int b = a - 1; b; b--) {
- int nr = a * 10 + b;
- if (!isInFile[nr]) {
- out[written] = nr;
- written++;
- }
- if (written == 2) {
- cout << out[0] << ' ' << out[1] << endl;
- return 0;
- }
- }
- }
- cout << "nu exista" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement