当前位置:网站首页>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
边栏推荐
猜你喜欢
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
Statistics 8th Edition Jia Junping Chapter 7 Summary of knowledge points and answers to exercises after class
Intranet information collection of Intranet penetration (4)
Intranet information collection of Intranet penetration (I)
《英特尔 oneAPI—打开异构新纪元》
ES全文索引
《统计学》第八版贾俊平第三章课后习题及答案总结
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
Applet Web Capture -fiddler
网络基础之路由详解
随机推荐
How to turn wechat applet into uniapp
《统计学》第八版贾俊平第十一章一元线性回归知识点总结及课后习题答案
【指针】使用插入排序法将n个数从小到大进行排列
数字电路基础(三)编码器和译码器
Overview of LNMP architecture and construction of related services
DVWA (5th week)
链队实现(C语言)
内网渗透之内网信息收集(一)
This article explains in detail how mockmvc is used in practical work
Hackmyvm target series (1) -webmaster
[issue 18] share a Netease go experience
Feature extraction and detection 14 plane object recognition
指針:最大值、最小值和平均值
Binary search tree concept
函数:求两个正数的最大公约数和最小公倍
The most popular colloquial system explains the base of numbers
Internet Management (Information Collection)
Intranet information collection of Intranet penetration (3)
C language file operation
内网渗透之内网信息收集(五)