当前位置:网站首页>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
边栏推荐
- sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现
- Get started with Matplotlib drawing
- 《统计学》第八版贾俊平第四章总结及课后习题答案
- 《统计学》第八版贾俊平第三章课后习题及答案总结
- “人生若只如初见”——RISC-V
- Hackmyvm target series (2) -warrior
- Based on authorized access, cross host, and permission allocation under sqlserver
- Hcip -- MPLS experiment
- Intel oneapi - opening a new era of heterogeneity
- 指针:最大值、最小值和平均值
猜你喜欢

Database monitoring SQL execution

Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?

captcha-killer验证码识别插件

Detailed explanation of network foundation

“Hello IC World”

《统计学》第八版贾俊平第五章概率与概率分布

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

5 minutes to master machine learning iris logical regression classification

内网渗透之内网信息收集(四)

High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
随机推荐
Attack and defense world misc practice area (simplerar, base64stego, no matter how high your Kung Fu is, you are afraid of kitchen knives)
函数:求1-1/2+1/3-1/4+1/5-1/6+1/7-…+1/n
Intranet information collection of Intranet penetration (I)
Function: find the root of the equation by Newton iterative method
Pointers: maximum, minimum, and average
List and data frame of R language experiment III
【指针】八进制转换为十进制
Wu Enda's latest interview! Data centric reasons
《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
《統計學》第八版賈俊平第七章知識點總結及課後習題答案
How to earn the first pot of gold in CSDN (we are all creators)
Record once, modify password logic vulnerability actual combat
Network technology related topics
Attack and defense world misc practice area (GIF lift table ext3)
Based on authorized access, cross host, and permission allocation under sqlserver
SQL injection
Record an API interface SQL injection practice
XSS unexpected event
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
图书管理系统