#include <stdio.h>
void swap(int x, int *y);
int main(void)
{
int a = 1;
int b = 2;
swap(a, &b);
printf("a = %d, b = %d\n", a
, b
); return 0;
}
void swap(int x, int *y)
{
int temp;
temp = x;
x = *y;
y = temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgc3dhcChpbnQgeCwgaW50ICp5KTsKaW50IG1haW4odm9pZCkKewppbnQgYSA9IDE7CmludCBiID0gMjsKc3dhcChhLCAmYik7CnByaW50ZigiYSA9ICVkLCBiID0gJWRcbiIsIGEsIGIpOwpyZXR1cm4gMDsKfQp2b2lkIHN3YXAoaW50IHgsIGludCAqeSkKewppbnQgdGVtcDsKdGVtcCA9IHg7CnggPSAqeTsKeSA9IHRlbXA7Cn0=