若m超过输入字符串的长度,
#include <stdio.h> //超过字符串长度时则输出空串,我的程序编写哪里错了
#define MAXN 20
void strmcpy( char *t, int m, char *s );
void ReadString( char s[] ); /* 由裁判实现,略去不表 */
int main()
{
char t[MAXN], s[MAXN];
int m;
scanf("%d\n", &m);
ReadString(t);
strmcpy( t, m, s );
printf("%s\n", s);
return 0;
}
void ReadString(char s[])
{
char s[MAXN];
gets(s);
}
void strmcpy( char *t, int m, char *s )
{
int i,j;
char tem;
for (i=m;i<MAXN;i++,j++)
{
tem=t[i];
s[i]=tem;
}
s[i]='\0';
}