当前位置:网站首页>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架构设计到使用场景-四种部署运行模式(上)
- Subgraph isomorphism -subgraph isomorphism
- NLP Chinese corpus project: large scale Chinese natural language processing corpus
- Entropy and full connection layer
- What is the potential of pocket network, which is favored by well-known investors?
- 数据库表外键的设计
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
- 功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
- MPLS experiment
- 关于 uintptr_t和intptr_t 类型
猜你喜欢
How to use AHAS to ensure the stability of Web services?
Release and visualization of related data
A dichotomy of Valentine's Day
功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
打印菱形图案
STM32 GPIO CSDN creative punch in
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
1-Redis架构设计到使用场景-四种部署运行模式(上)
Gauss elimination method and template code
Future源码一观-JUC系列
随机推荐
How to use AHAS to ensure the stability of Web services?
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
Is it really possible that the monthly salary is 3K and the monthly salary is 15K?
12. Go implementation of integer to Roman numeral and leetcode
Several ways to set up a blog locally [attach relevant software download links]
Test the influence of influent swacth on the electromagnetic coil of quartz meter
The super fully automated test learning materials sorted out after a long talk with a Tencent eight year old test all night! (full of dry goods
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
Unity Shader入门精要读书笔记 第三章 Unity Shader基础
Similarities and differences of text similarity between Jaccard and cosine
STM32 GPIO CSDN creative punch in
Joint examination of six provinces 2017
The difference between objects and objects
Global and Chinese market of breast cancer imaging 2022-2028: Research Report on technology, participants, trends, market size and share
1214 print diamond
不得不会的Oracle数据库知识点(一)
不得不会的Oracle数据库知识点(四)
Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
For loop
HR disgusted interview behavior