当前位置:网站首页>C string array reverse
C string array reverse
2022-08-01 01:08: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;
}
边栏推荐
- Redis五种数据类型简介
- 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
- ECCV2022 Workshop | Multi-Object Tracking and Segmentation in Complex Environments
- WebApi hits an Attribute to handle exceptions uniformly
- SC7A20 (Silan Micro-Accelerometer) Example
- Carefully summarize thirteen suggestions to help you create more suitable MySQL indexes
- sqlserver cannot connect remotely
- WindowInsetsControllerCompat简单使用
- LeetCode每日一练 —— 环形链表问题(面试四连问)
- Rasa 3.x 学习系列- Rasa - Issues 4898 学习笔记
猜你喜欢
Google "Cloud Developer Quick Checklist"; Tsinghua 3D Human Body Dataset; SenseTime "Universal Vision Framework" open class; Web3 Minimalist Getting Started Guide; Free Books for Efficient Deep Learni
STK8321 I2C(昇佳-加速度传感器)示例
cobaltstrike
Matlab / Arcgis处理nc数据
RTL8762DK RTC(五)
MYSQL逻辑架构
微信小程序之小程序页面语法
Kyoto University:Masaki Waga | 黑箱环境中强化学习的动态屏蔽
力扣二叉树
蓝图:杨辉三角排列
随机推荐
Team of Professor Chen Jianyu of Tsinghua University | Contact Safety Reinforcement Learning Framework Based on Contact-rich Robot Operation
Web3.0: Building an NFT Market (1)
Rasa 3.x 学习系列- Rasa - Issues 4898 学习笔记
Item 36: Specify std::launch::async if asynchronicity is essential.
精心总结十三条建议,帮你创建更合适的MySQL索引
WindowInsetsControllerCompat简单使用
One line of code to solve CoreData managed object properties change in SwiftUI problem of animation effects
js 实现复制功能
leetcode: 1648. Color ball with decreasing sales value [Boundary find by two points]
Kyoto University:Masaki Waga | 黑箱环境中强化学习的动态屏蔽
类和对象:中
Unity3D学习笔记10——纹理数组
Web API 介绍和类型
[微服务]分布式事务解决方案-Seata
Kyoto University: Masaki Waga | Dynamic Masking for Reinforcement Learning in Black Box Environments
【历史上的今天】7 月 31 日:“缸中之脑”的提出者诞生;Wi-Fi 之父出生;USB 3.1 标准发布
精心总结十三条建议,帮你创建更合适的MySQL索引
What practical projects can machine learning beginners learn?
Rasa 3.x Study Series - Rasa - Issues 4898 Study Notes
pycaret source code analysis: download dataset\Lib\site-packages\pycaret\datasets.py