Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- ifstream f("bac.txt");
- int a, maxim = -1;
- while (f >> a) {
- if (a >= maxim) {
- cout << a << " ";
- maxim = a;
- }
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement