Ŀ

գҪıйص䡣
һ repeat (0<repeat<10) repeat 㣺
һַ t һ mַ t дӵ m ַʼȫַƵַ s Уַ s
Ҫ岢ú strmcpy(s,t,m), Ĺǽַ t дӵ m ַʼȫַƵַ s Уβstַָ룬βmintvoid
ʾΪ˵
룺
3              (repeat=3
happy new year
7
happy
1
new
4

new year        ("happy new year"7ַʼɵַΪ"new year"
happy           ("happy"1ַʼɵַΪ"happy"
error input     ("new"ĳС4



#include<stdio.h>
#include<string.h>
void main()
{
    char s[80], t[80];
    int m;
    int repeat, ri;
    void strmcpy(char *s,char *t, int m);

    scanf("%d", &repeat);
    getchar();
    for(ri = 1; ri <= repeat; ri++){
        gets(t);
        scanf("%d", &m);
        getchar();
        if(strlen(t) < m)
            printf("error input");
        else{
/*---------*/
            puts(s);
        }
    }
}

/*---------*/

