You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
499 B
27 lines
499 B
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
int n;
|
|
const int N = 110;
|
|
int a[N], al;
|
|
int sum;
|
|
|
|
int main() {
|
|
int T;
|
|
cin >> T;
|
|
while(T--){
|
|
io al = 0;
|
|
sum = 0;
|
|
cin >> n;
|
|
int t = n;
|
|
while(n){
|
|
a[++al] = n % 10;
|
|
n /= 10;
|
|
}
|
|
for (int i = 1; i <= al; i++) sum += pow(a[i], al);
|
|
|
|
if (sum == t) cout << "T" << endl;
|
|
else
|
|
cout << "F" << endl;
|
|
}
|
|
return 0;
|
|
} |