当前位置:网站首页>C语言逆序输出字符串
C语言逆序输出字符串
2022-07-27 14:45:00 【andrewhxc】
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Reverse(const char *str, char *ptr);
int main()
{
char str[100];
char ptr[100];
printf("Input a string:");
gets(str);
Reverse(str, ptr);
printf("Inversed results:%s\n", ptr);
}
void Reverse(const char* str, char* ptr)
{
int n = strlen(str);
int i;
for (i = 0; i <= n; i++) {
ptr[i] = str[n - i - 1];
}
ptr[i - 1] = '\0';
}
边栏推荐
- Taking advantage of 5g Dongfeng, does MediaTek want to fight the high-end market again?
- Your password does not satisfy the current policy requirements (modify MySQL password policy setting simple password)
- 论文缩小
- 2.2 basic elements of JMeter
- Time series ARIMA model
- Excel extract duplicates
- Crmeb Pro v1.4 makes the user experience more brilliant!
- Join hands with sifive, Galanz will enter the semiconductor field! Exposure of two self-developed chips
- TP5 paging some small points
- 快速高效删除node_modules
猜你喜欢

matlab legend用法

2.2 JMeter基本元件

Excel extract duplicates

Determine the exact type of data

JMeter5.3 及以后的版本jmeter函数助手生成的字符在置灰无法复制

Security software related to wireless network analysis (airtrack ng)

Mysql5.7 master-slave hot standby settings on CentOS

Axure install Icon Font Catalog

Yys mouse connector

Boolean value
随机推荐
Openwrt new platform compilation
Axure install Icon Font Catalog
Test novice learning classic (with ideas)
Crmeb Pro v1.4 makes the user experience more brilliant!
solidwork装配体导入到Adams中出现多个Part重名和Part丢失的情况处理
Your password does not satisfy the current policy requirements (modify MySQL password policy setting simple password)
DeFi安全之DEX与AMMs
Scratch crawler framework
JSP Foundation
移动端h5常见问题
Solve the problem that Flink cannot be closed normally after startup
Axure 安装图标字体元件库
Introduction to JWT
TP5 paging some small points
减小PDF文档大小(转载)
: 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解
Redis简介与使用
Time series ARIMA model
ARIMA模型选择与残差
Servlet基础知识点