当前位置:网站首页>Pointer -- output all characters in the string in reverse order
Pointer -- output all characters in the string in reverse order
2022-07-06 14:35:00 【|Light|】
requirement
Programming , Enter a string , Output all characters in reverse order .( Use a pointer to achieve )
Code
/* * This function implements string a Reverse operation of , If the original string is string, Reverse order followed by gnirts, * Please store the string after reverse order in a In what it points to */
void reverse(char *a)
{
int n = strlen(a);
int b[n],c = 0;
for(int i = n-1;i>=0;i--)
{
b[c] = a[i];
c++;
}
for(int i = 0;i<n;i++)
{
a[i] = b[i];
}
}
main function
int main()
{
char a[200];
gets(a);
reverse(a);
puts(a);
return 0;
}
test
Test input
I am a student
Output
tneduts a ma I
边栏推荐
- 《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
- Windows platform mongodb database installation
- XSS (cross site scripting attack) for security interview
- [issue 18] share a Netease go experience
- Build domain environment (win)
- 《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
- Record an API interface SQL injection practice
- SQL injection
- Statistics 8th Edition Jia Junping Chapter XIII Summary of knowledge points of time series analysis and prediction and answers to exercises after class
- Résumé des points de connaissance et des réponses aux exercices après la classe du chapitre 7 de Jia junping dans la huitième édition des statistiques
猜你喜欢
Hackmyvm target series (2) -warrior
Applet Web Capture -fiddler
Only 40% of the articles are original? Here comes the modification method
Hackmyvm target series (1) -webmaster
Intranet information collection of Intranet penetration (2)
《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
Lintcode logo queries the two nearest saplings
Statistics 8th Edition Jia Junping Chapter XIII Summary of knowledge points of time series analysis and prediction and answers to exercises after class
Record once, modify password logic vulnerability actual combat
数据库多表链接的查询方式
随机推荐
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
数字电路基础(五)算术运算电路
Sword finger offer 23 - print binary tree from top to bottom
JVM memory model concept
Function: find the root of the equation by Newton iterative method
Only 40% of the articles are original? Here comes the modification method
内网渗透之内网信息收集(一)
“人生若只如初见”——RISC-V
《统计学》第八版贾俊平第二章课后习题及答案总结
安全面试之XSS(跨站脚本攻击)
5 minutes to master machine learning iris logical regression classification
XSS (cross site scripting attack) for security interview
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
MySQL中什么是索引?常用的索引有哪些种类?索引在什么情况下会失效?
SQL injection
AQS details
Interview Essentials: what is the mysterious framework asking?
How to test whether an object is a proxy- How to test if an object is a Proxy?
Realize applet payment function with applet cloud development (including source code)
Markdown font color editing teaching