fork download
  1. #include <stdio.h>
  2. void swap(int *x,int *y);
  3. void sort(int *x,int *y);
  4. int main(void) {
  5. int a,b;
  6. scanf("%d%d",&a,&b);
  7. sort(&a,&b);
  8. printf("小さい数から順に%d,%d",a,b);
  9. return 0;
  10. }
  11. void swap(int *x,int *y){
  12. if(*x<*y){
  13. return;
  14. }
  15. else{
  16. int text;
  17. text = *x;
  18. *x = *y;
  19. *y = text;
  20. }
  21. }
  22. void sort(int *x,int *y){
  23. swap(x,y);
  24. }
  25.  
Success #stdin #stdout 0.01s 5276KB
stdin
7 56
stdout
小さい数から順に7,56