当前位置:网站首页>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);
}
边栏推荐
- 删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
- 功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
- From functional testing to automated testing, how did I successfully transform my salary to 15K +?
- Unity elementary case notes of angry birds Siki college 1-6
- [common error] UART cannot receive data error
- What are the application fields of digital twins in industry?
- Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
- Arc 135 supplementary report
- Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
- [dynamic programming] leetcode 53: maximum subarray sum
猜你喜欢
A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
机器学习基础:用 Lasso 做特征选择
What is the potential of pocket network, which is favored by well-known investors?
A dichotomy of Valentine's Day
2-redis architecture design to use scenarios - four deployment and operation modes (Part 2)
Several ways to set up a blog locally [attach relevant software download links]
Recommendation of knowledge base management system
Network layer - routing
A-Frame虚拟现实开发入门
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
随机推荐
A dichotomy of Valentine's Day
Is user authentication really simple
Wechat official account and synchronization assistant
Shell script three swordsman sed
机器学习基础:用 Lasso 做特征选择
MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
不得不会的Oracle数据库知识点(三)
[C language] break and continue in switch statement
Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
[NLP] text classification still stays at Bert? Duality is too strong than learning framework
It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence
Analysis and solution of lazyinitializationexception
Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
[PHP basics] cookie basics, application case code and attack and defense
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
URL (data:image/png; Base64, ivborw0k... Use case
Future源码一观-JUC系列
[leetcode] interview question 17.08 Circus tower
MySQL is installed as a Windows Service
Is the account opening of Guoyuan securities really safe and reliable