当前位置:网站首页>C字符串数组反转
C字符串数组反转
2022-08-01 00:30:00 【ma_de_hao_mei_le】
友链
#include <stdio.h>
#include <string.h>
void reverse(char* s) {
int len = strlen(s);
for (int i = 0; i < len / 2; i++) {
int diff = *(s + i) - *(s + (len - i - 1));
*(s + i) = *(s + i) - diff;
*(s + (len - i - 1)) = *(s + (len - i - 1)) + diff;
}
}
int main()
{
char s[123] = "1234567890";
reverse(s);
printf("%s\n", s);
return 0;
}
边栏推荐
- 虹科分享|如何用移动目标防御技术防范未知因素
- Pylint检查规则中文版
- SVN server construction + SVN client + TeamCity integrated environment construction + VS2019 development
- 南方科技大学:Xiaoying Tang | AADG:视网膜图像分割领域泛化的自动增强
- 2022-07-31:给出一个有n个点,m条有向边的图, 你可以施展魔法,把有向边,变成无向边, 比如A到B的有向边,权重为7。施展魔法之后,A和B通过该边到达彼此的代价都是7。 求,允许施展一次魔法
- JVM面试题总结(持续更新中)
- lua入门案例实战1234定义函数与标准函数库功能
- To help the construction of digital government, the three parties of China Science and Technology build a domain name security system
- LeetCode--The problem of robbery
- 继承的注意事项
猜你喜欢

【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀

How to Design High Availability and High Performance Middleware - Homework

如何设计高可用高性能中间件 - 作业

Kyoto University: Masaki Waga | Dynamic Masking for Reinforcement Learning in Black Box Environments

MYSQL二阶段提交
![[Reading Notes -> Data Analysis] 02 Data Analysis Preparation](/img/e7/258daf851746cb043f301437ee3bbe.png)
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation

【读书笔记->数据分析】02 数据分析准备

Matlab / Arcgis处理nc数据

/etc/sysconfig/network-scripts configure the network card

Key Points Estimation and Point Instance
随机推荐
pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py
推荐系统:常用评价指标总结【准确率、精确率、召回率、命中率、(归一化折损累计增益)NDCG、平均倒数排名(MRR)、ROC曲线、AUC(ROC曲线下的面积)、P-R曲线、A/B测试】
谷歌『云开发者速查表』;清华3D人体数据集;商汤『通用视觉框架』公开课;Web3极简入门指南;高效深度学习免费书;前沿论文 | ShowMeAI资讯日报
[AMEX] LGBM Optuna American Express Credit Card Fraud Contest kaggle
虚继承的原理
Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC
什么是动态规划,什么是背包问题
欧拉系统(euleros):升级Mysql
The difference between /usr/local/bin and /usr/bin
In 2022, the latest eight Chongqing construction members (electrical construction workers) simulation question bank and answers
IPD process terminology
【1161. 最大层内元素和】
EntityFramework保存到SQLServer 小数精度丢失
Compose原理-视图和数据双向绑定的原理
JVM面试题总结(持续更新中)
声称AI存在意识,谷歌工程师遭解雇:违反保密协议
An open source and easy-to-use flowchart drawing tool drawio
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
WeChat applet page syntax
vim的基本使用-底行模式