实验十(二)-1、输入一个字符串和一个正整数x,将该字符串中的后x个字符复制到另一个字符串y中,输出字符串y;再对y串的内容前后倒置后存入数组z中并输出。

#include"stdio.h"
#include"string.h"
void getx(char *c1);
void getr(char *c2);
int main()
{
    char str1[20];
    printf("Enter a string:");
    gets(str1);
    printf("Enter an integer:");
    getx(str1);
    return 0;
}

void getx(char *c1)
{
    int n,i,j=0,r=0;
    char str2[20];
    scanf("%d",&n);
    while(*(c1+j)!='