已过,可参考
查看原帖
已过,可参考
1586975
zk20140402楼主2025/2/8 15:44
#include<bits/stdc++.h>
using namespace std;
int main () {
	int m;
	cin >> m;
	while (m--) {
		int x, ans = 0,cnt=0;
		cin >> x; 
		int xxx = x; 
		while (xxx) {
			cnt++;
			xxx/=10;
		}
		xxx=x;
		while (xxx > 0) {
			ans += pow(xxx % 10,cnt);
			xxx /= 10;
		}
		if (ans == x)
			cout << "T" << endl;
		else
			cout << "F" << endl;
	}
	return 0;
}
2025/2/8 15:44
加载中...