c语言pat基础题0902L1078

img

img


我的代码出现问题,本题希望可以得到大家的指导,谢谢你的帮助!

供参考:

#include <stdio.h>
#include <string.h>
int main()
{
    char s[501] = {0},s1[501] = {0};
    int  i, n, m, cnt;
    scanf("%d %d", &n, &m);
    getchar();
    for(i = 0,cnt = 0; i < n; i++)
    {
        gets(s);
        if (!strstr(s,"qiandao") && !strstr(s,"easy")){
            cnt ++;
            if(cnt > m)  strcpy(s1,s);
        }
    }
    if(cnt <= m)
        printf("Wo AK le\n");
    else
        printf("%s\n",s1);
    return 0;
}

【以下回答由 GPT 生成】

我很抱歉,但你没有提供你的代码以供我检查。请将你的代码粘贴在问题描述中,我将尽力提供指导和帮助。



【相关推荐】



如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^