Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.  
  8. ifstream f("bac.txt");
  9. int a, maxim = -1;
  10.  
  11. while (f >> a) {
  12.  
  13. if (a >= maxim) {
  14. cout << a << " ";
  15. maxim = a;
  16. }
  17. }
  18.  
  19. cout << endl;
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement