15分求助!
查看原帖
15分求助!
1789086
TF_zeh楼主2025/8/5 11:54
#include <bits/stdc++.h>
using namespace std;
int m,w,t,a,b,c,sum;
int main(){
    cin>>m;
    for (int i=0;i<m;i++){
        cin>>a;
        b=t=a;
        w=0;
        while (a){
            a/=10;
            w++;
        }
        while (t){
            c=t%10;
            sum+=pow(c,w);
            t/=10;
        }
        if (sum==b)
            cout<<'T'<<endl;
        else
            cout<<'F'<<endl;
    }
    return 0;
}
2025/8/5 11:54
加载中...