当前位置:网站首页>Function: string storage in reverse order
Function: string storage in reverse order
2022-07-06 14:35:00 【|Light|】
requirement
Write a function , Make an input string stored in reverse order .
Code
#include<string.h>
#include<stdio.h>
/* * This function implements the reverse order of strings */
void reverse(char a[])
{
int i,j,l;
gets(a);
i = strlen(a);
int k=0;
l = i-1;
char b[i+1];
strcpy(b,a);
for(j=0;j<i;j++)
{
a[k] = b[l];
k=k+1;
l=l-1;
}
}
test
Test input
Be honest rather clever.
Output
.revelc rehtar tsenoh eB
边栏推荐
猜你喜欢
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
Intel oneapi - opening a new era of heterogeneity
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
JVM memory model concept
Attack and defense world misc practice area (GIF lift table ext3)
Intranet information collection of Intranet penetration (I)
On the idea of vulnerability discovery
Realize applet payment function with applet cloud development (including source code)
Record an edu, SQL injection practice
How to turn wechat applet into uniapp
随机推荐
c语言学习总结(上)(更新中)
Circular queue (C language)
XSS unexpected event
2022华中杯数学建模思路
How to turn wechat applet into uniapp
【指针】求字符串的长度
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
msf生成payload大全
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
《统计学》第八版贾俊平第二章课后习题及答案总结
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
Record an edu, SQL injection practice
Windows platform mongodb database installation
Network layer - simple ARP disconnection
[issue 18] share a Netease go experience
移植蜂鸟E203内核至达芬奇pro35T【集创芯来RISC-V杯】(一)
关于交换a和b的值的四种方法
Detailed explanation of network foundation routing
New version of postman flows [introductory teaching chapter 01 send request]
【指针】统计一字符串在另一个字符串中出现的次数