求为啥WA
查看原帖
求为啥WA
1409772
Jastion楼主2024/12/31 22:54
#include<iostream>
#include<cmath>
using namespace std;
int n, x, arr[19];
int nod(int num) {
	int sum = 0;
	while (num) {
		sum++;
		num /= 10;
	}
	return sum;
}
int main() {
	cin >> n;
	while (n--) {
		cin >> x;
		int s = 0;
		while (x) {
			s += pow(x % 10, nod(x));
			x /= 10;
		}
		cout << (s == x ? 'T' : 'F') << endl;
	}
	return 0;
}
2024/12/31 22:54
加载中...