📄 book10_7.cpp
字号:
#include <stdio.h>
void CopyM(char *str1,char * str2,int m)
{
str1=str1+m-1;
while(*str1!='\0')
{
*str2=*str1;
str2++;
str1++;
}
*str2='\0';
}
void main()
{
int m;
char str1[100],str2[100];
printf("please input a string:");
scanf("%s",str1);
printf("please input m:");
scanf("%d",&m);
CopyM(str1,str2,m);
printf("%s",str2);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -