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




stdout
4 5 6