当前位置:网站首页>Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
2022-07-04 00:41:00 【CTGU-Yoghurt】
subject :
Code details :
#include <stdio.h>
#include <conio.h>
#include <string.h>
#define N 81
void fun(char* str, int n)
{
/**********Program**********/
int i,t;
for (i = 0; i < n/2;i++) {
t = str[i];
str[i] = str[n - i - 1];
str[ n-i - 1] = t;
}
/********** End **********/
}
int main()
{
char s[N];
int l;
printf("input a string:"); scanf("%s", &s);
l = strlen(s);
fun(s, l);
printf("The new string is :"); puts(s);
}
边栏推荐
- 不得不会的Oracle数据库知识点(二)
- Is the low commission link on the internet safe? How to open an account for China Merchants Securities?
- Future source code view -juc series
- 2020.2.14
- 关于 uintptr_t和intptr_t 类型
- 数据库表外键的设计
- For loop
- Development and application of fcitx functional plug-ins
- Release and visualization of related data
- Is user authentication really simple
猜你喜欢

查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题

The FISCO bcos console calls the contract and reports an error does not exist
![[error record] configure NDK header file path in Visual Studio](/img/9f/89f68c037dcf68a31a2de064dd8471.jpg)
[error record] configure NDK header file path in Visual Studio

Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services

Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
![Several ways to set up a blog locally [attach relevant software download links]](/img/2f/51a09d9ef71065319ed90306517854.jpg)
Several ways to set up a blog locally [attach relevant software download links]

Is user authentication really simple
![[prefix and notes] prefix and introduction and use](/img/a6/a75e287ac481559d8f733e6ca3e59c.jpg)
[prefix and notes] prefix and introduction and use
![[C language] break and continue in switch statement](/img/ae/5967fefcf3262c9d3096e5c7d644fd.jpg)
[C language] break and continue in switch statement

Struct in linked list
随机推荐
A dichotomy of Valentine's Day
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
Future源码一观-JUC系列
For loop
Social network analysis -social network analysis
The difference between objects and objects
MPLS experiment
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
[error record] configure NDK header file path in Visual Studio
手机异步发送短信验证码解决方案-Celery+redis
CSP window
删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
[CSDN Q & A] experience and suggestions
[NLP] text classification still stays at Bert? Duality is too strong than learning framework
What is the future of software testing industry? Listen to the test veterans' answers
Speed up the energy Internet of things. What can low-power Internet of things technology represented by Zeta do?
Future source code view -juc series
From functools import reduce -- see the use of reduce function from typical examples
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
The difference between fetchtype lazy and eagle in JPA