当前位置:网站首页>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);
}
边栏推荐
- 1-Redis架构设计到使用场景-四种部署运行模式(上)
- MPLS experiment
- 我管你什么okr还是kpi,PPT轻松交给你
- 打印菱形图案
- Recommendation of knowledge base management system
- Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
- How to use AHAS to ensure the stability of Web services?
- From functional testing to automated testing, how did I successfully transform my salary to 15K +?
- swagger中响应参数为Boolean或是integer如何设置响应描述信息
- [error record] configure NDK header file path in Visual Studio
猜你喜欢
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
MySQL winter vacation self-study 2022 12 (1)
Reading notes on how programs run
Entropy and full connection layer
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
Future source code view -juc series
Windos10 reinstallation system tutorial
The difference between objects and objects
Analysis and solution of lazyinitializationexception
@EnableAsync @Async
随机推荐
Self study software testing. To what extent can you go out and find a job?
功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
Network layer - routing
Subgraph isomorphism -subgraph isomorphism
不得不会的Oracle数据库知识点(一)
What are the application fields of digital twins in industry?
Severity code description the project file line prohibits the display of status error c4996 fopen ('fscanf ', StrCmp): this function or variable may be unsafe The most comprehensive solution
删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
Struct in linked list
Stock price forecast
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
AI Challenger 2018 text mining competition related solutions and code summary
[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept
Future源码一观-JUC系列
Analysis and solution of lazyinitializationexception
Qtcharts notes (V) scatter diagram qscatterseries
Is it really possible that the monthly salary is 3K and the monthly salary is 15K?
[leetcode] interview question 17.08 Circus tower
HR disgusted interview behavior
Att & CK actual combat series - red team actual combat - V