15分求助
查看原帖
15分求助
1591936
yjr18069209682楼主2025/7/26 17:42

没找到错误,样例都过了。

#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;
}

2025/7/26 17:42
加载中...