当前位置:网站首页>Write code, and multiple characters move from both ends to converge in the middle
Write code, and multiple characters move from both ends to converge in the middle
2022-07-24 03:19:00 【Grumpy applet ape】
Write code , Multiple characters move from both ends , Converging in the middle
Write code , Multiple characters move from both ends , Converging in the middle , The renderings are as follows :
The code is as follows :
#include<stdio.h>
#include<string.h>
#include<Windows.h>
int main()
{
char arr1[]="welcome to bit!!!!!!";
char arr2[]="######################";
int left=0;
int right=strlen(arr1)-1;// Be careful strlen Header file is required, otherwise there will be a warning
// Use header file #include<strig.h>
while(left<=right)
{
arr1[left]=arr2[left];
arr2[right]=arr1[right];
printf("%s\n",arr2);
Sleep(1000);// rest 1000 millisecond ( sleep 1 second ), Note that header files must be added #include<windows.h>
system("cla");// Clear the screen ;
left++;
right—-;
}
printf("%s\n",arr2);
return 0;
}
strlen subtract 1 reason : because strlen The length of the string is found , from 1 At the beginning , And the subscript is from 0 At the beginning , So subtract 1 To get the corresponding subscript ;
summary
Hopefully that helped , Remember to pay attention to the third company !
边栏推荐
- FTP service and configuration
- An introductory example of structure and combinatorial ideas in go language
- Ugui source code analysis - maskablegraphic
- Take you into the world of MySQL mvcc
- SolidWorks CAM data cannot be recovered because a processed part has been detected.
- Outlook client outlook.com mailbox setting method
- B. Eastern Exhibition- Codeforces Round #703 (Div. 2)
- Unity message push
- Daily gossip (I)
- CMT 注册——Google Scholar Id,Semantic Scholar Id,和 DBLP Id
猜你喜欢

MySql的DDL和DML和DQL的基本语法

The process of solving a bug at work

Simulink code generation: variable subsystem and its code

JS 數組 isAarray() typeof

JS array isaarray() typeof

The implementation in unity determines whether missing or null

Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?

Hcip day 10 (initial BGP border gateway protocol)

MySQL sub database and sub table and its smooth expansion scheme

JS small game running bear and cat source code
随机推荐
Data Lake: comparative analysis of open source data Lake schemes deltalake, Hudi and iceberg
uva11389
QT custom class uses custom parametric signals and slots
Cannot resolve symbol 'override' of idea clone‘
二分查找
About Aries framework addition, deletion, modification and query - query demo
Redux Usage Summary
JVM初始
[AMC] federal quantification
Binary tree traversal
It's solved with a cry
Lcd1602——斌哥51
正则表达式 \b \B 深入浅出理解单词边界的匹配
Is the reverse repurchase of treasury bonds safe? How to open an account online?
Advantages, disadvantages and summary of sequence list and linked list
Go IO operation - file write
B. Eastern Exhibition- Codeforces Round #703 (Div. 2)
Keras deep learning practice (15) -- realize Yolo target detection from scratch
JVM initial
Go log package