当前位置:网站首页>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 download files through URL links
- Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material
- JVM垃圾回收机
- Use vscode to view hex or UTF-8 codes
- Go: send the get request and parse the return JSON (go1.16.4)
- 叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
- jvm-类加载
- Print. JS -- web page file printing
- Solution to failure or slow downloading of electron when electron uses electron builder to package
- FPGA test method takes mentor tool as an example
猜你喜欢

“又土又穷”的草根高校,凭什么被称为“东北小清华”?

解决MySql 1045 Access denied for user ‘root‘@‘localhost‘ (using password: YES)

7-7 12-24 hour system

交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳

QT learning 24 layout manager (III)

Print. JS -- web page file printing

从零开始的基于百度大脑EasyData的多人协同数据标注

信创产业现状、分析与预测

QT learning 21 standard dialog box in QT (Part 2)

Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material
随机推荐
Qt学习18 登录对话框实例分析
玖逸云黑免费无加密版本源码
[acnoi2022] guess numbers
Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
Go language web development series 29: Gin framework uses gin contrib / sessions library to manage sessions (based on cookies)
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
Generate directories from web content
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
Use and design of Muduo buffer class
7-8 overspeed judgment
How to bold text in AI
RocksDB LRUCache
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
虽然不一定最优秀,但一定是最努力的!
Qt学习24 布局管理器(三)
Interface for querying IP home
Too many files with unapproved license
项目协作的进度如何推进| 社区征文
QT learning 25 layout manager (4)