P2955 [USACO09OCT]Even? Odd? G

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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;
}