fork(1) download
  1. #include <stdio.h>
  2.  
  3. void swap(int *x, int *y){
  4. int temp;
  5. temp = *x;
  6. *x = *y;
  7. *y = temp;
  8. }
  9. void sort(int x, int *y){
  10. if(x < *y){
  11. swap(&x, y);
  12. }
  13. }
  14. int main(void) {
  15. int x, y;
  16. printf("x : "); scanf("%d", &x);
  17. printf("y : "); scanf("%d", &y);
  18. sort(x, &y);
  19. printf("降順: x = %d, y = %d\n", x, y);
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
x : y : 降順: x = -1766900080, y = -1766900080