当前位置:网站首页>兩個數相互替換
兩個數相互替換
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);
}
边栏推荐
- 模板的进阶
- PermissionError: [Errno 13] Permission denied: ‘data. csv‘
- 微服务(Microservice)那点事儿
- The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
- PMP certificate renewal process
- Introduction to ACM combination counting
- P4281 [ahoi2008] emergency assembly / gathering (LCA)
- [IELTS reading] Wang Xiwei reading P4 (matching1)
- How to do the project of computer remote company in foreign Internet?
- 【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
猜你喜欢
IELTS examination process, what to pay attention to and how to review?
IT转测试岗,从迷茫到坚定我究竟付出了什么?
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
【selenium自动化】常用注解
基本放大电路的学习
Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system
Mit-6.824-lab4b-2022 (10000 word idea explanation - code construction)
华为200万年薪聘请数据治理专家!背后的千亿市场值得关注
Date time type and format in MySQL
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
随机推荐
How to avoid arc generation—— Aafd fault arc detector solves the problem for you
Using fast parsing intranet penetration to realize zero cost self built website
Fast analysis -- easy to use intranet security software
abc 258 G - Triangle(bitset)
ORB(Oriented FAST and Rotated BRIEF)
JS 将伪数组转换成数组
OpenHarmony资源管理详解
Basic points of the game setup of the points mall
[IELTS reading] Wang Xiwei reading P3 (heading)
Significance of acrel EMS integrated energy efficiency platform in campus construction
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
What is the difference between port mapping and port forwarding
Hash table, hash function, bloom filter, consistency hash
如何避免电弧产生?—— AAFD故障电弧探测器为您解决
"Xiaodeng" domain password policy enhancer in operation and maintenance
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
【雅思阅读】王希伟阅读P4(matching1)
打新债开户注册安全吗?有没有风险的?靠谱吗?
如何报考PMP项目管理认证考试?
Summary of week 22-07-02