不允许创建临时变量,交换两个数的内容
2014-12-25 21:02
316 查看
#include<stdio.h> void exchang(int *x,int *y) { *x = *x - *y; *y = *x + *y; *x = *y - *x; printf("%d %d\n",*x,*y); } int main() { int a; int b; int *m=&a; int *n=&b; scanf("%d %d",&a,&b); exchang( m,n); return 0; }
相关文章推荐
- 不允许创建临时变量,交换两个数的内容
- C语言 不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容
- C语言中不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容(附加题)
- 不允许创建临时变量,交换两个数的内容
- 1. 给定两个整形变量的值,将两个值的内容进行交换。 2. 不允许创建临时变量,交换两个数的内容(附加题) 3. 求10 个整数中最大值。 4. 写一个函数返回参数二进制中 1 的个数
- 不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容
- 【c语言】不允许创建临时变量,交换两个数的内容
- 【C语言】不允许创建临时变量,交换两个数的内容。
- 不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容(用异或实现)
- 不允许创建临时变量,交换两个数的内容
- 【c语言】不允许创建临时变量,交换两个数的内容
- 不允许创建临时变量,交换两个数的内容。
- 1. 给定两个整形变量的值,将两个值的内容进行交换。 2. 不允许创建临时变量,交换两个数的内容(附加题) 3. 求10 个整数中最大值。 4. 写一个函数返回参数二进制中 1 的个数
- C语言中不允许创建临时变量,交换两个数的内容