数据范围,emmm,果断字符串做

#include <stdio.h>
#include <string.h>
#define scan(x) scanf("%d", &x)

int main()
{
    char s[10000];
    int a, x;
    scan(a);
    while (a--)
    {
        scanf("%s", s);
        x = s[strlen(s) - 1] - '0';
        if (x & 1)
            printf("odd\n");
        else
            printf("even\n");
    }
    return 0;
}
此文章已被阅读次数:正在加载...更新于