当前位置:网站首页>两个数相互替换
两个数相互替换
2022-07-05 00:12:00 【sunyin.liu】
#include <stdio.h>
void swap(int a, int b);
int main(){
int a = 5;
int b = 6;
// printf("a=%d,b=%d\n",a,b);
printf("a=%d,b=%d\n",a,b);
swap(a,b);
return 0;
}
void swap(int a,int b){
a = a ^ b;
b = a ^ b;
a = a ^ b;
printf("a=%d,b=%d\n",a,b);
}
边栏推荐
- JS convert pseudo array to array
- 基于三维gis平台的消防系统运用
- Significance of acrel EMS integrated energy efficiency platform in campus construction
- 业务场景功能的继续修改
- Using fast parsing intranet penetration to realize zero cost self built website
- 多回路仪表在基站“转改直”方面的应用
- Five papers recommended for the new development of convolutional neural network in deep learning
- A new method for analyzing the trend chart of London Silver
- Data on the number of functional divisions of national wetland parks in Qinghai Province, data on the distribution of wetlands and marshes across the country, and natural reserves in provinces, cities
- lambda表达式
猜你喜欢
"Xiaodeng" domain password policy enhancer in operation and maintenance
端口映射和端口转发区别是什么
IELTS examination process, what to pay attention to and how to review?
How to effectively monitor the DC column head cabinet
XML的解析
如何有效对直流列头柜进行监测
Some basic functions of enterprise projects are developed, and important things are saved to online first a
URL和URI
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Application of multi loop instrument in base station "switching to direct"
随机推荐
Meet ThreadPoolExecutor
Face recognition 5- insight face padding code practice notes
How to effectively monitor the DC column head cabinet
如何在外地外网电脑远程公司项目?
微服务(Microservice)那点事儿
快解析内网穿透帮助企业快速实现协同办公
【selenium自动化】常用注解
Skills in analyzing the trend chart of London Silver
(脚本)一键部署redis任意版本 —— 筑梦之路
Chinese verification of JS regular expressions (turn)
Jar batch management gadget
In the enterprise, win10 turns on BitLocker to lock the disk, how to back up the system, how to recover when the system has problems, and how to recover quickly while taking into account system securi
Is it safe to open an account in the College of Finance and economics? How to open an account?
【雅思阅读】王希伟阅读P4(matching2段落信息配对题【困难】)
海思3559万能平台搭建:YUV422的踩坑记录
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
模板的进阶
Summary of week 22-07-02
[Peking University] tensorflow2.0-1-opening
[IELTS reading] Wang Xiwei reading P4 (matching1)