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 frecv[101]={0}, a, i, j = -1, ok, ok2;
- ok=ok2=0;
- while (fin >> a)
- frecv[a]++;
- for (i = 0; i <= 100; i++)
- {
- if (!(frecv[i]))
- ok++;
- else
- {
- if (ok >= 1 && j != -1)
- {
- cout << j << " " << i << '\n';
- ok2++;
- j = i;
- ok = 0;
- }
- else
- {
- j = i;
- ok = 0;
- }
- }
- }
- if (ok2 == 0)
- cout << "Nu exista";
- fin.close();
- return 0;
- }
Add Comment
Please, Sign In to add comment