#include<stdio.h> void swap(int* a,int *b) { /* int temp = *a; *a = * b; *b = temp; */ *a += *b; *b = *a - *b; *a = *a - *b; } int main() { int a = 10; int b = 20; swap(&a,&b); printf("a = %d,b = %d\n",a,b); }
原文地址:https://www.cnblogs.com/wanghao-boke/p/11020404.html
时间: 2024-10-12 16:07:36