当前位置:网站首页>兩個數相互替換
兩個數相互替換
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);
}
边栏推荐
- Cross domain request
- Face recognition 5- insight face padding code practice notes
- 股票账户佣金怎么调低,炒股佣金怎么调低网上开户安全吗
- Introduction to ACM combination counting
- Verilog tutorial (11) initial block in Verilog
- 人生无常,大肠包小肠, 这次真的可以回家看媳妇去了。。。
- Summer challenge brings you to play harmoniyos multi terminal piano performance
- How long does it take to obtain a PMP certificate?
- Basic points of the game setup of the points mall
- Microservice
猜你喜欢
Summer challenge brings you to play harmoniyos multi terminal piano performance
【selenium自动化】常用注解
同事的接口文档我每次看着就头大,毛病多多。。。
[IELTS reading] Wang Xiwei reading P3 (heading)
【雅思阅读】王希伟阅读P4(matching1)
多回路仪表在基站“转改直”方面的应用
图解网络:什么是网关负载均衡协议GLBP?
How long does it take to obtain a PMP certificate?
P3304 [sdoi2013] diameter (diameter of tree)
URL和URI
随机推荐
JS convert pseudo array to array
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
圖解網絡:什麼是網關負載均衡協議GLBP?
Using fast parsing intranet penetration to realize zero cost self built website
积分商城游戏设置的基本要点
Significance of acrel EMS integrated energy efficiency platform in campus construction
IELTS examination process, what to pay attention to and how to review?
Skills in analyzing the trend chart of London Silver
Continuous modification of business scenario functions
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
Is it safe to open an account in the College of Finance and economics? How to open an account?
GDB常用命令
企业应用业务场景,功能添加和修改C#源码
22-07-02周总结
P4281 [ahoi2008] emergency assembly / gathering (LCA)
Parsing of XML
Pytoch --- use pytoch to realize linknet for semantic segmentation
快解析内网穿透帮助企业快速实现协同办公
How to apply for PMP project management certification examination?
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])