字母(PTA-武理-C)
发布时间
阅读量:
阅读量
本题需要设计一个函数,用于将输入字符串的前三个字符移动至末尾位置。
函数接口定义如下:
void Shift( char s[] );
其中char s[]为用户提供的字符串,题目已确保其长度不少于3个字符;函数Shift需按照规定完成字符串的变换,并将结果存储于s[]中。
裁判测试程序示例:
#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;
【}
/* 你的代码将被嵌入于此处 */
输入示例:
abcdef
输出示例:
defabc
void Shift( char s[] )
{
int i,j;char a[3];
for(i=0;i
全部评论 (0)
还没有任何评论哟~
