ac

黄昏中的雷霆  •  13小时前


include

include

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;

}


评论:

请先登录,才能进行评论