当前位置:网站首页>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
边栏推荐
- 使用 flask_whooshalchemyplus jieba实现flask的全局搜索
- 函数:字符串反序存放
- Numpy快速上手指南
- 《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
- An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
- 《统计学》第八版贾俊平第一章课后习题及答案总结
- Web vulnerability - File Inclusion Vulnerability of file operation
- Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
- 1.支付系统
- Statistics, 8th Edition, Jia Junping, Chapter VIII, summary of knowledge points of hypothesis test and answers to exercises after class
猜你喜欢

四元数---基本概念(转载)

Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary

《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案

Detailed explanation of network foundation routing

攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)

SystemVerilog discusses loop loop structure and built-in loop variable I

《统计学》第八版贾俊平第四章总结及课后习题答案

On the idea of vulnerability discovery

Attack and defense world misc practice area (GIF lift table ext3)

数字电路基础(四) 数据分配器、数据选择器和数值比较器
随机推荐
攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)
Constants, variables, and operators of SystemVerilog usage
Pointers: maximum, minimum, and average
Based on authorized access, cross host, and permission allocation under sqlserver
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
我的第一篇博客
Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
线程的实现方式总结
New version of postman flows [introductory teaching chapter 01 send request]
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
函数:求两个正数的最大公约数和最小公倍
图书管理系统
How to earn the first pot of gold in CSDN (we are all creators)
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
Function: calculates the number of uppercase letters in a string
Sword finger offer 23 - print binary tree from top to bottom
An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
List and data frame of R language experiment III
【指针】求解最后留下的人
“人生若只如初见”——RISC-V