文章
145
粉丝
217
获赞
21
访问
84.5k
#include <stdio.h>
#include <string.h>
//复制
void Copy(char *s,char *t,int l,int r)
{
char *p,*q;
p = s;
int i = 0;
while(p < s+l) p++;
while(p < s+l+r)
{
t[i++] = *p;
p++;
}
t[i++] = *p;
t[i] = '\0';
puts(s);
}
//剪切
void Cut(char *s,char *t,int l,int r)
{
char *p,*q;
p = s;
int i = 0;
while(p < s+l) p++;
q = p;
while(q < s+l+r)
{
t[i++] = *q;
q++;
}
t[i] = '\0';
while(*q != '\0')
{
*p = *q;
p++;
q++;
}
*p = '\0';
puts(s);
}
//粘贴
void Paste(char *s,char *t,int m)
{
char tt[1000],*p,*q;
p = s;
while(p < s+m) p++;
q = p+1;
strcpy(tt,q);
p++;
q = t;
while(*q != '\0')
{
*p = *q;
p++;
q++;
}
*p = '\0';
strcat(s,tt);
puts(s);
}
int main()
{
char s[1000];
int n,i;
while(scanf("%s",s) != EOF)
{
char t[1000] = "pqr";
scanf("%d",&n);
for(i = 0; i < n; i++)
{
int l,r;
char op[6];
scanf("%s",op);
if...
登录后发布评论
暂无评论,来抢沙发