#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
long long a, num2 = 0, num1 = 0;
int j = 0, z = 1;
scanf("%lld", &a);
while (a != 0) {
int b;
b = a % 10;
a /= 10;
if (z % 2 == 1) {
b *= 7;
while (b > 9) {
int c = 0;
while (b > 0) {
c += b % 10;
b /= 10;
}
b = c;
}
}
z++;
num1 += b * pow(10, j);
j++;
}
while (num1 != 0) {
num2 += num1 % 10;
num1 /= 10;
}
if (num2 % 8 == 0) {
printf("T\n");
} else {
printf("F\n");
}
}
return 0;
}
全部回复 共 0 条
还没有人回复。往下写第一条。
发表回复
登录后即可回复本帖,与出题人和同学一起讨论。
登录