#include <stdio.h>
#include <stdbool.h>
#include <string.h>
char p1[20];
char p2[20]="hello";
char pl[20];
int main(void)
{
char *p;
char *t;
char *kl;
int i;
int j=0;
p=p1;
t=p2;
kl=pl;
printf("请你输入一串字符:\n");
scanf("%s",p1);
getchar();
printf("请你输入下标:\n");
scanf("%d",&i);
while(*p!='\0')
{
printf("%c",*p++);
}
printf("\n");
p=p1;
while(*p!='\0')
{
if(j==i)
{
break;
}
*kl=*p;
*kl++;
printf("%c",*p++);
j++;
}
printf("\n");
while(*t!='\0')
{
printf("%c",*t++);
}
while(*p!='\0')
{
*t=*p;
*t++;
*p++;
}
//p=p1;
t=p2;
printf("\n");
while(*t!='\0')
{
printf("%c",*t++);
}
printf("\n");
kl=pl;
while(*kl!='\0')
{
printf("%c",*kl++);
}
printf("\n");
t=p2;
while(*t!='\0')
{
*kl=*t;
*t++;
*kl++;
}
kl=pl;
while(*kl!='\0')
{
printf("%c",*kl++);
}
}