当前位置:网站首页>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];
}
}
边栏推荐
- Qt学习20 Qt 中的标准对话框(中)
- JS Part III
- Print. JS -- web page file printing
- How to use lxml to judge whether the website announcement is updated
- Duet date picker (time plug-in that can manually enter the date)
- Collection of mobile adaptation related articles
- JVM family - overview, program counter day1-1
- UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
- 核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
- Qt学习18 登录对话框实例分析
猜你喜欢

JVM family - overview, program counter day1-1
![Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:](/img/2f/33504391a661ecb63d42d75acf3a37.png)
Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:

GoLand 2021.1: rename the go project

Qt学习20 Qt 中的标准对话框(中)

Exercise 6-1 classify and count the number of characters

Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material
[email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂"/>金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂

jvm-类加载

Qt学习24 布局管理器(三)

7-9 find a small ball with a balance
随机推荐
Summary of common error reporting problems and positioning methods of thrift
Fabric. JS document
[combinatorics] permutation and combination (two counting principles, examples of set permutation | examples of set permutation and circle permutation)
Metal organic framework MOFs loaded with non steroidal anti-inflammatory drugs | zif-8 wrapped Prussian blue loaded quercetin (preparation method)
JVM垃圾回收机
Interface for querying IP home
JS new challenges
Exercise 9-3 plane vector addition
Implementation of Muduo accept connection, disconnection and sending data
GoLand 2021.2 configure go (go1.17.6)
Raft 协议
Canvas utility library fabric JS user manual
simpleParallax. JS (create poor visual effects for website pictures)
Configure stylelint
全局事件总线
Selenium browser (1)
How to promote the progress of project collaboration | community essay solicitation
QT learning 24 layout manager (III)
Duet date picker (time plug-in that can manually enter the date)
Uniapp skills - dom display and hiding