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 a[81] = {}, x, n = 0, poz;
- bool gasit = 0;
- while (fin >> x)
- {
- a[++n] = x;
- }
- for (int i = 1; i <= n - 2; ++i)
- {
- if (a[i] < a[i + 2] && !gasit) {gasit = 1, poz = i + 2; break;}
- cout << a[i] << ' ';
- }
- if (gasit) for (int i = poz; i <= n; ++i) cout << a[i] << ' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement