#include <stdio.h>
void swap(int *a, int b);
int main(void)
{
int a[4] = {1, 2, 3, 4};
int b = 3;
swap(a+1, b);
printf("a[0] = %d, a[1] = %d, b = %d\n", a
[0], a
[1], b
); return 0;
}
void swap(int *a, int b)
{
int temp;
temp = *a;
*a = b;
b = temp;
}
CiNpbmNsdWRlIDxzdGRpby5oPgogdm9pZCBzd2FwKGludCAqYSwgaW50IGIpOwogaW50IG1haW4odm9pZCkKIHsKICAgIGludCBhWzRdID0gezEsIDIsIDMsIDR9OwogICAgaW50IGIgPSAzOwogICAgc3dhcChhKzEsIGIpOwogICAgcHJpbnRmKCJhWzBdID0gJWQsIGFbMV0gPSAlZCwgYiA9ICVkXG4iLCBhWzBdLCBhWzFdLCBiKTsKICAgIHJldHVybiAwOwogfQogdm9pZCBzd2FwKGludCAqYSwgaW50IGIpCiB7CiAgICBpbnQgdGVtcDsKICAgIHRlbXAgPSAqYTsKICphID0gYjsKIGIgPSB0ZW1wOwogfQ==