当前位置:网站首页>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);
}
边栏推荐
- [C language] break and continue in switch statement
- 国元证券开户是真的安全可靠吗
- Reading notes on how programs run
- MySQL winter vacation self-study 2022 12 (1)
- 不得不会的Oracle数据库知识点(四)
- Sequence list and linked list
- [PHP basics] cookie basics, application case code and attack and defense
- [about text classification trick] things you don't know
- Global and Chinese market of melting furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese markets for blood and liquid heating devices 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Interview script of Software Test Engineer

打印菱形图案

The difference between objects and objects

Analysis and solution of lazyinitializationexception

Makefile judge custom variables

Unity Shader入门精要读书笔记 第三章 Unity Shader基础

Joint examination of six provinces 2017

Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing

Sorry, Tencent I also refused

GUI 应用:socket 网络聊天室
随机推荐
Why use get/set instead of exposing properties
Subgraph isomorphism -subgraph isomorphism
MySQL winter vacation self-study 2022 12 (2)
2-redis architecture design to use scenarios - four deployment and operation modes (Part 2)
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
2-Redis架构设计到使用场景-四种部署运行模式(下)
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
7.1 学习内容
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
PMP 考试常见工具与技术点总结
Sorry, Tencent I also refused
Analysis and solution of lazyinitializationexception
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
Test the influence of influent swacth on the electromagnetic coil of quartz meter
Wechat official account and synchronization assistant
Future source code view -juc series
关于 uintptr_t和intptr_t 类型
Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers