10-不使用中间变量,实现变量值之间互换

来源:互联网 发布:关联分析算法的优点 编辑:程序博客网 时间:2024/06/07 23:04
#include <stdio.h>#include <stdlib.h>#include <math.h>/***不使用中间变量,将两个变量的值进行交换 */main() {        int a=3,b=4;a=a^b;b=b^a;a=a^b;printf("%d,%d",a,b);     //控制台暂停    getch();} 

0 0
原创粉丝点击