fork download
  1. #include <stdio.h>
  2. void scanfall(int*x,int*y,int*z);
  3.  
  4. void ascend(int*x,int*y,int*z);
  5.  
  6. void swap(int*x,int*y);
  7. int main(void) {
  8. int a,b,c;
  9. scanfall(&a,&b,&c);
  10. ascend(&a,&b,&c);
  11. printf("a=%d,b=%d,c=%d",a,b,c);
  12. return 0;
  13. }
  14. void scanfall(int*x,int*y,int*z){
  15. scanf("%d",x);
  16. scanf("%d",y);
  17. scanf("%d",z);
  18. return;
  19. }
  20. void ascend(int*x,int*y,int*z){
  21. if(*x>*y)
  22. swap(x,y);
  23. if(*x>*z)
  24. swap(x,z);
  25. if(*y>*z)
  26. swap(y,z);
  27. return;
  28. }
  29. void swap(int*x,int*y){
  30. int temp;
  31. temp=*x;
  32. *x=*y;
  33. *y=temp;
  34. return;
  35. }
  36.  
Success #stdin #stdout 0.01s 5268KB
stdin
12 11 10
stdout
a=10,b=11,c=12