当前位置:网站首页>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
边栏推荐
- Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
- Uibutton status exploration and customization
- JDBC看这篇就够了
- 数据库多表链接的查询方式
- Only 40% of the articles are original? Here comes the modification method
- The most popular colloquial system explains the base of numbers
- msf生成payload大全
- Sword finger offer 23 - print binary tree from top to bottom
- 内网渗透之内网信息收集(三)
- Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
猜你喜欢
Only 40% of the articles are original? Here comes the modification method
Web vulnerability - File Inclusion Vulnerability of file operation
Data mining - a discussion on sample imbalance in classification problems
Realize applet payment function with applet cloud development (including source code)
《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
How does SQLite count the data that meets another condition under the data that has been classified once
Statistics 8th Edition Jia Junping Chapter IX summary of knowledge points of classified data analysis and answers to exercises after class
Network layer - simple ARP disconnection
《统计学》第八版贾俊平第十二章多元线性回归知识点总结及课后习题答案
数字电路基础(四) 数据分配器、数据选择器和数值比较器
随机推荐
《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
Statistics 8th Edition Jia Junping Chapter 7 Summary of knowledge points and answers to exercises after class
JDBC read this article is enough
High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
Web vulnerability - File Inclusion Vulnerability of file operation
攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)
Statistics, 8th Edition, Jia Junping, Chapter 6 Summary of knowledge points of statistics and sampling distribution and answers to exercises after class
《英特尔 oneAPI—打开异构新纪元》
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
Realize applet payment function with applet cloud development (including source code)
Uibutton status exploration and customization
指针:最大值、最小值和平均值
SQL injection
《統計學》第八版賈俊平第七章知識點總結及課後習題答案
Mathematical modeling idea of 2022 central China Cup
This article explains in detail how mockmvc is used in practical work
内网渗透之内网信息收集(二)
【指针】使用插入排序法将n个数从小到大进行排列
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
Chain team implementation (C language)