fork download
  1. #include <stdio.h>
  2.  
  3. f(p,n)int*p;{n>1?*p<p[1]?*p=p[1]:f(p+1,n-1):0;}
  4.  
  5. int main(void)
  6. {
  7. int l[5] = { 3, 1, 4, -1, 2 };
  8. f(l,5);
  9. for(int i=0;i<5;i++) printf("%d ",l[i]);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
3 4 4 -1 2