fork download
  1. #include <stdio.h>
  2. #define NUM 10
  3.  
  4. int main(void) {
  5. int a[6]={43,64,62,54,23,57};
  6. int max=0,tmp=0;
  7. for(int i=0;i<6;i++){
  8. if(max<a[i]){
  9. tmp=max;
  10. max=a[i];
  11. a[i]=tmp;
  12. }
  13. printf("%d,",a[i]);
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 5320KB
stdin
25
39
42
76
35
48
81
41
74
55
stdout
0,43,62,54,23,57,