126. 整數交換

 avatar
user_6817964
c_cpp
2 years ago
255 B
3
Indexable
void swap(int* x, int* y);

void swap(int *x, int *y) {
	int temp;
	temp = *x;
	*x = *y;
	*y = temp;
}


int main() {

    int a;
    int b;

    scanf("%d %d", &a, &b);
    swap(&a, &b);
    printf("%d %d\n", a, b);

    return 0;

}
Editor is loading...