当前位置:网站首页>功能:将主函数中输入的字符串反序存放。例如:输入字符串“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);
}
边栏推荐
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Briefly understand the operation mode of developing NFT platform
- Axure resources and prototype tool Axure RP 9 download
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
- Gossip about redis source code 76
- Global and Chinese market of glossometer 2022-2028: Research Report on technology, participants, trends, market size and share
- A method to solve Bert long text matching
- What is the potential of pocket network, which is favored by well-known investors?
- SPI based on firmware library
猜你喜欢
Entropy and full connection layer
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
[Mongodb] 2. Use mongodb --------- use compass
Makefile judge custom variables
SPI based on firmware library
NLP Chinese corpus project: large scale Chinese natural language processing corpus
Data mining vs Machine Learning: what is the difference between them? Which is more suitable for you to learn
A dichotomy of Valentine's Day
Similarities and differences of text similarity between Jaccard and cosine
Smart fan system based on stm32f407
随机推荐
Iclr2022: how does AI recognize "things I haven't seen"?
What does redis do? Redis often practices grammar every day
[error record] configure NDK header file path in Visual Studio
Pytorch learning notes 5: model creation
Make small tip
Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
Regular expressions and text processors for shell programming
Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
P1656 bombing Railway
What is the Valentine's Day gift given by the operator to the product?
The difference between objects and objects
Advanced C language - pointer 2 - knowledge points sorting
Double efficiency. Six easy-to-use pychar plug-ins are recommended
Gossip about redis source code 83
BBS forum recommendation
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
Gossip about redis source code 77
Detailed explanation of the relationship between Zhongtai, wechat and DDD
STM32 key light