当前位置:网站首页>功能:将主函数中输入的字符串反序存放。例如:输入字符串“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);
}
边栏推荐
- 挖财帮个人开的证券账户安全吗?是不是有套路
- Generic
- [PHP basics] session basic knowledge, application case code and attack and defense
- ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
- Gossip about redis source code 80
- A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
- Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
- Is user authentication really simple
- A method to solve Bert long text matching
- Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Unity elementary case notes of angry birds Siki college 1-6

What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
![[CSDN Q & A] experience and suggestions](/img/db/dff3173dda24ca5740729b54a81153.jpg)
[CSDN Q & A] experience and suggestions
![[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections](/img/c6/3dc7d01600f6713afdbb4cf3df5238.jpg)
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections

Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

MySQL winter vacation self-study 2022 12 (1)

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

Idea a method for starting multiple instances of a service

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
随机推荐
【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
[CSDN Q & A] experience and suggestions
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
Briefly understand the operation mode of developing NFT platform
NLP Chinese corpus project: large scale Chinese natural language processing corpus
Is the account opening of Guoyuan securities really safe and reliable
Version rollback revert don't reset better reset must be forced
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)
Eight year test old bird, some suggestions for 1-3 year programmers
Distributed transaction -- middleware of TCC -- selection / comparison
Struct in linked list
MySQL winter vacation self-study 2022 12 (1)
[software testing] you haven't mastered these real interview questions of big companies?
Gossip about redis source code 77
Gossip about redis source code 83
What insurance products should be bought for the elderly?
What is the difference between NFT, SFT and dnft? How to build NFT platform applications?
Shell script three swordsman sed
Sorry, Tencent I also refused
Gossip about redis source code 75