当前位置:网站首页>两个数相互替换
两个数相互替换
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);
}
边栏推荐
- Meet ThreadPoolExecutor
- 《论文笔记》Multi-UAV Collaborative Monocular SLAM
- 城市轨道交通站应急照明疏散指示系统设计
- 人脸识别5- insight-face-paddle-代码实战笔记
- 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
- OpenHarmony资源管理详解
- How to use fast parsing to make IOT cloud platform
- How long does it take to obtain a PMP certificate?
- A new method for analyzing the trend chart of London Silver
- How to effectively monitor the DC column head cabinet
猜你喜欢
海思3559万能平台搭建:YUV422的踩坑记录
He worked as a foreign lead and paid off all the housing loans in a year
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
Microservice
[path planning] RRT adds dynamic model for trajectory planning
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
Verilog tutorial (11) initial block in Verilog
Pytoch --- use pytoch to realize linknet for semantic segmentation
随机推荐
Expand your kubecl function
AcWing164. 可达性统计(拓扑排序+bitset)
PMP证书续证流程
他做国外LEAD,用了一年时间,把所有房贷都还清了
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
股票账户佣金怎么调低,炒股佣金怎么调低网上开户安全吗
Illustrated network: what is gateway load balancing protocol GLBP?
Application of fire fighting system based on 3D GIS platform
同事的接口文档我每次看着就头大,毛病多多。。。
[paper reading] cavemix: a simple data augmentation method for brain vision segmentation
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
GDB常用命令
Combien de temps faut - il pour obtenir un certificat PMP?
How to save your code works quickly to better protect your labor achievements
A new method for analyzing the trend chart of London Silver
The input of uniapp is invalid except for numbers
如果炒股开华泰证券的户,在网上开户安全吗?
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
Skills in analyzing the trend chart of London Silver
【雅思阅读】王希伟阅读P4(matching2段落信息配对题【困难】)