fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, a, b;
  6. cin >> n;
  7. cin >> a;
  8. for(int i = 0; i < n; i++) {
  9. cin >> b;
  10. if(b > a) {
  11. cout << b << " ";
  12. }
  13. a = b;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 4332KB
stdin
7
14 16 3 7 17 19 9
stdout
16 7 17 19