#include<bits/stdc++.h>
using namespace std;
long long n, sum, tmp, cnt, a[121];
int main() {
cin >> n;
for (long long i = 1; i <= n; i++) {
cin >> tmp;
cnt = sum = 0;
while (tmp > 0) {
a[cnt] = tmp % 10;
tmp /= 10;
cnt++;
}
for (long long j = 0; j < cnt; j++) {
if(j%2==0){
a[j]*=7;
while(a[j]>9)a[j]=a[j]%10+a[j]/10;
}
sum += a[j];
}
if (sum % 8 == 0)cout << "T" << endl;
else cout << "F" << endl;
}
return 0;
}
B3850 [GESP202306 四级] 幸运数
最新推荐文章于 2024-06-14 14:40:57 发布