#include #include // 计算一个数的位数int countDigits(int num) { int count = 0; while (num) { num /= 10; count++; } return count;}// 判断是否为自幂数int isArmstrong(int num) { int originalNum = num; int n = countDigits(num); int sum = 0; while (num) { int digit = num % 10; sum += (int)pow(digit, n); num /= 10; } return (sum == originalNum);}int main() { int M; scanf("%d", &M); for (int i = 0; i int num; scanf("%d", &num); if (isArmstrong(num)) { printf("T\n"); } else { printf("F\n"); } } return 0;}