当前位置:网站首页>两个数相互替换
两个数相互替换
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);
}
边栏推荐
- Upload avatar on uniapp
- Basic points of the game setup of the points mall
- 2022.07.03(LC_6111_统计放置房子的方式数)
- 挖财学院开户安全的吗?开户怎么开?
- 22-07-02周总结
- 人脸识别5- insight-face-paddle-代码实战笔记
- Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
- Enterprise application business scenarios, function addition and modification of C source code
- Nine Qi single chip microcomputer ny8b062d single key control four LED States
- 如何用快解析自制IoT云平台
猜你喜欢

Hash table, hash function, bloom filter, consistency hash

Microservice

How to use fast parsing to make IOT cloud platform

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

香港珠宝大亨,22亿“抄底”佐丹奴

XML的解析

Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)

华为200万年薪聘请数据治理专家!背后的千亿市场值得关注

Mit-6.824-lab4b-2022 (10000 word idea explanation - code construction)

Application of fire fighting system based on 3D GIS platform
随机推荐
Jar batch management gadget
Expand your kubecl function
人生无常,大肠包小肠, 这次真的可以回家看媳妇去了。。。
How to use fast parsing to make IOT cloud platform
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
How to avoid arc generation—— Aafd fault arc detector solves the problem for you
How to reduce the stock account Commission and stock speculation commission? Is it safe to open an online account
A new method for analyzing the trend chart of London Silver
Tester's algorithm interview question - find mode
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
P3304 [sdoi2013] diameter (diameter of tree)
What is the difference between port mapping and port forwarding
Combien de temps faut - il pour obtenir un certificat PMP?
如何将自己的代码作品快速存证,已更好的保护自己劳动成果
GDB常用命令
业务实现-日志写到同一个行数据里面
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
「运维有小邓」域密码策略强化器
【监控】zabbix