当前位置:网站首页>两个数相互替换
两个数相互替换
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);
}
边栏推荐
- 多回路仪表在基站“转改直”方面的应用
- Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system
- 电力运维云平台:开启电力系统“无人值班、少人值守”新模式
- 2022.07.03(LC_6108_解密消息)
- 初识ROS
- 城市轨道交通站应急照明疏散指示系统设计
- Acrel-EMS综合能效平台在校园建设的意义
- The pit of sizeof operator in C language
- 如果炒股开华泰证券的户,在网上开户安全吗?
- go踩坑——no required module provides package : go.mod file not found in current directory or any parent
猜你喜欢

IT转测试岗,从迷茫到坚定我究竟付出了什么?

A new method for analyzing the trend chart of London Silver

What is the difference between port mapping and port forwarding

多回路仪表在基站“转改直”方面的应用

Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?

端口映射和端口转发区别是什么

「运维有小邓」域密码策略强化器

Pytoch --- use pytoch to realize linknet for semantic segmentation

业务场景功能的继续修改

Using the uniapp rich text editor
随机推荐
Acrel-EMS综合能效平台在校园建设的意义
香港珠宝大亨,22亿“抄底”佐丹奴
基于三维gis平台的消防系统运用
[paper reading] cavemix: a simple data augmentation method for brain vision segmentation
[kotlin] the third day
JS how to realize array to tree
Instructions for go defer
Nine Qi single chip microcomputer ny8b062d single key control four LED States
企业应用业务场景,功能添加和修改C#源码
Design of emergency lighting evacuation indication system for urban rail transit station
如何用快解析自制IoT云平台
45 year old professor, she threw two super unicorns
Paddleocr tutorial
股票账户佣金怎么调低,炒股佣金怎么调低网上开户安全吗
海思3559万能平台搭建:YUV422的踩坑记录
实战模拟│JWT 登录认证
How many triangles are there in the golden K-line diagram?
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
如何避免电弧产生?—— AAFD故障电弧探测器为您解决
《论文笔记》Multi-UAV Collaborative Monocular SLAM