#Perl 5, (29 Bytes+2) = 31
A regex-less solution.
map{print$i=$_.' ',if$_>$i}@F
Test
Note that the @F array is filled because the -a switch is used.
$ echo 1 2 5 4 3 7 |perl -na -e 'map{print$i=$_.' ',if$_>$i}@F'
1 2 5 7
#Perl 5, (29 Bytes+2) = 31
A regex-less solution.
map{print$i=$_.' ',if$_>$i}@F
Note that the @F array is filled because the -a switch is used.
$ echo 1 2 5 4 3 7 |perl -na -e 'map{print$i=$_.' ',if$_>$i}@F'
1 2 5 7