C语言面试资格确认题

在小熊猫DevC++中运行结果如预期但是在头歌平台中又不能通过
题目和输入例题

img

img


写的代码

img

img

试试这样写,供参考:

#include <stdio.h>
#include <string.h>
int main()
{
    int  age;
    char str1[16], str2[16];
    scanf("%d %s %s", &age, str1, str2);
    if ((strcmp(str1, "EIE") == 0 && (age > 25 || strcmp(str2, "A") == 0)) ||
        (strcmp(str1, "CS")  == 0 && age < 28) )
        printf("YES");
    else
        printf("NO");
    return 0;
}

Dev-C++和头歌平台使用的编译器可能不同,因此代码的编译和运行结果也可能不同。