不允许创建临时变量,交换两个数的内容

时间:2015-10-19 01:56:48   收藏:0   阅读:232

#include<stdio.h>

 void main()

{

 int a=1,b=2;

 a=a^b;

 b=a^b;

 a=a^b;

 printf("a=%d\n",a);

 printf("b=%d\n",b);

 return 0;

}


原文:http://w2558213.blog.51cto.com/10800718/1704057

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!