fork(1) download
  1. #include <stdio.h>
  2.  
  3. void swap(int *a,int *b);
  4. int main(void) {
  5. // your code goes here
  6. int a,b;
  7. scanf("%d%d",&a,&b);
  8. swap(&a,&b);
  9. printf("(左から小さい順) a = %d b = %d",a,b);
  10. return 0;
  11. }
  12. void swap(int *a,int *b){
  13. int w;
  14. w = *a;
  15. *a = *b;
  16. *b = w;
  17. }
  18.  
Success #stdin #stdout 0s 5320KB
stdin
3
5
stdout
(左から小さい順) a = 5 b = 3