60分,大佬求助!
查看原帖
60分,大佬求助!
1106440
freebrave楼主2023/11/10 19:02
#include <stdio.h>

int main()
{
    int x = 0;
    int a, b, c, d;
    scanf("%d", &x);
    a = (x > 4 && x <= 12 && x % 2 == 0) ? 1 : 0;
    b = (x > 4 && x <= 12) || (x % 2 == 0) ? 1 : 0;
    c = (x > 4 && x <= 12 && x % 2 == 0) ? 0 : 1;
    d = !((x > 4 && x <= 12 && x % 2 == 0) || (x % 2 != 0 && (x <= 4 || x > 12))) ? 1 : 0;
    printf("%d %d %d %d", a, b, c, d);
    return 0;
}
2023/11/10 19:02
加载中...