zoukankan
html css js c++ java
两数交换不借助第三变量
#include <stdio.h> void swap(int *x, int *y) { *y = *x ^ *y; *x = *x ^ *y; *y = *x ^ *y; } void revert(int *a, int len) { int first = 0, last = len - 1; for (;first < last; first++, last--) swap(&a[first], &a[last]); } int main() { int i, a[] = {1 ,2, 3, 4, 5}; revert(a, 5); for (i = 0; i < 5; i++) printf("%2d", a[i]); getch(); }
查看全文
相关阅读:
大二(上期)学期末个人学习总结
《梦断代码》阅读笔记01
软件工程概论课程评价
03《构建之法》阅读笔记第三篇(终结篇)
02《构建之法》阅读笔记第二篇
个人简评——2345王牌拼音输入法
《人件集》阅读笔记第一篇
个人学习进度条
AcWing ST算法(区间求最值)打卡
AcWing 101. 最高的牛 (差分) 打卡
原文地址:https://www.cnblogs.com/seebro/p/2476516.html
最新文章
cd 命令的具体使用说明
vi命令
mybatis 配置 log4j 日志
org/w3c/dom/ElementTraversal 错误解决办法
naoting
FreeMarker 生成Java、mybatis文件
在mysql数据库中创建oracle scott用户的四个表及插入初始化数据
C语言完美体系
普通程序员如何转向AI方向
小白学习IOT之模拟设备[CCP协议]消息队列上报
热门文章
什么样的程序猿,最容易被鄙视?
程序员面试什么最重要?
我是码农_我适合创业吗?
被同事要求帮修电脑时怎么拒绝最好?
【代码优化】如何提高网页加载速度
项目失败了?!怎么补救才能不被裁?
7月5日云栖精选夜读:物联网技术在农业领域的应用
Docker容器内部安装Nginx
《阅读笔记》03
《梦断代码》阅读笔记02
Copyright © 2011-2022 走看看