没找到错误,样例都过了。
#include<bits/stdc++.h>
using namespace std;
int main(){
long long t;
cin>>t;
while(t--){
long long x,x1,x2;
cin>>x;
x1=x,x2=x;
long long sum=0,t=0;
while(x1!=0){
t++;
x1/=10;
}
while(x2!=0){
sum+=pow(x2%10,t);
x2/=10;
}
if(sum==x){
cout<<"T\n";
break;
}
else{
cout<<"F\n";
}
}
return 0;
}