Files
python/TangDou/LanQiaoBei/ZhongGaoJi/LanQiao15STEMA202401/hags.cpp

30 lines
495 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
bool check(int x) {
int len = to_string(x).size();
int sum = 0, t = x;
while (t) {
int a = t % 10;
sum += pow(a, len);
t /= 10;
}
return x == sum;
}
int main() {
int T;
cin >> T;//times
while (T--) {
int a;
cin >> a;
if (check(a))
cout << 'T' << endl;
else
cout << 'F' << endl;
}
return 0;
}