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