1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】13.指针1/6-4 移动字母.md

46 lines
723 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 6-4 移动字母
本题要求编写函数将输入字符串的前3个字符移到最后。
### 函数接口定义:
```c++
void Shift( char s[] );
```
其中`char s[]`是用户传入的字符串题目保证其长度不小于3函数`Shift`须将按照要求变换后的字符串仍然存在`s[]`里。
### 裁判测试程序样例:
```c++
#include <stdio.h>
#include <string.h>
#define MAXS 10
void Shift( char s[] );
void GetString( char s[] ); /* 实现细节在此不表 */
int main()
{
char s[MAXS];
GetString(s);
Shift(s);
printf("%s\n", s);
return 0;
}
/* 你的代码将被嵌在这里 */
```
### 输入样例:
```in
abcdef
```
### 输出样例:
```out
defabc
```