当前位置:网站首页>功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
2022-07-04 00:33:00 【CTGU-Yoghurt】
题目:
代码详解:
#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);
}
边栏推荐
- MySQL winter vacation self-study 2022 12 (2)
- Solution to the impact of Remote Code Execution Vulnerability of log4j2 component on December 9, 2021
- system. Exit (0) and system exit(1)
- MySQL winter vacation self-study 2022 12 (1)
- Is the account opening of Guoyuan securities really safe and reliable
- Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
- [CSDN Q & A] experience and suggestions
- What insurance products should be bought for the elderly?
- Gossip about redis source code 80
- No qualifying bean of type ‘com. netflix. discovery. AbstractDiscoveryClientOptionalArgs<?>‘ available
猜你喜欢

Recommendation of knowledge base management system

STM32 GPIO CSDN creative punch in

Pytorch learning notes 5: model creation

NLP Chinese corpus project: large scale Chinese natural language processing corpus

Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

MySQL is installed as a Windows Service

Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution

Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
随机推荐
Global and Chinese market of process beer equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Shell script three swordsman sed
Is user authentication really simple
AI Challenger 2018 text mining competition related solutions and code summary
Tencent interview: can you find the number of 1 in binary?
Introduction to thread pool
Gossip about redis source code 82
Gossip about redis source code 80
ISBN number
Sorry, Tencent I also refused
Gossip about redis source code 73
P1656 bombing Railway
Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028
I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
Vscode regular match replace console log(.*)
Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
[C language] break and continue in switch statement
Several ways to set up a blog locally [attach relevant software download links]
Self study software testing. To what extent can you go out and find a job?
A method to solve Bert long text matching