当前位置:网站首页>Exercise 8-8 moving letters
Exercise 8-8 moving letters
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
practice 8-8 Moving letters (10 branch )
This problem requires writing functions , The first... Of the input string 3 Move characters to the last .
Function interface definition :
void Shift( char s[] );
among char s[] Is the string passed in by the user , Ensure that the length of the title is not less than 3; function Shift The string transformed as required must still exist s[] in .
Sample referee test procedure :
#include <stdio.h>
#include <string.h>
#define MAXS 10
void Shift( char s[] );
void GetString( char s[] ); /* Implementation details are not shown here */
int main()
{
char s[MAXS];
GetString(s);
Shift(s);
printf("%s\n", s);
return 0;
}
/* Your code will be embedded here */
sample input :
abcdef
sample output :
defabcvoid Shift( char s[] ){
char a[3];
int j,i;
for(i=0;i<3;i++){
a[i]=s[i];
}
for(i=3;s[i];i++){
s[i-3]=s[i];
}
for(j=i-3,i=0;i<3;i++){
s[j++]=a[i];
}
}
边栏推荐
- JS new challenges
- JS matrix zero
- Implementation of Muduo accept connection, disconnection and sending data
- JVM垃圾回收机
- Go language web development series 27: Gin framework: using gin swagger to implement interface documents
- QT learning 23 layout manager (II)
- Uniapp tips - scrolling components
- Similarities and differences of sessionstorage, localstorage and cookies
- Reflection -- basic usage
- Qt学习17 对话框及其类型
猜你喜欢

Use and design of Muduo buffer class

Page generation QR code

Exercise 7-6 count capital consonants

Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?

3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)

jvm-运行时数据区

Go language web development series 30: gin: grouping by version for routing

Qt学习25 布局管理器(四)

Rasp implementation of PHP
[email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂"/>金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
随机推荐
Conversion function and explicit
八大排序
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
7-7 12-24 hour system
Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
Back to top implementation
QT learning 24 layout manager (III)
使用vscode查看Hex或UTF-8编码
Thrift threadmanager and three monitors
JS first summary
Common network state detection and analysis tools
GoLand 2021.1.1: configure the multi line display of the tab of the open file
金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
Go: send the get request and parse the return JSON (go1.16.4)
How to delete an attribute or method of an object
Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material
Multi person collaborative data annotation based on Baidu brain easydata from scratch
FPGA test method takes mentor tool as an example
Qt学习20 Qt 中的标准对话框(中)