求助,样例过不了
查看原帖
求助,样例过不了
1360496
NullPointerExpection楼主2024/6/15 08:44
#include <bits/stdc++.h>
using namespace std;

int n, m, sum, p;
int main() {
	scanf("%d", &m);
	while(m--) {
		scanf("%d", &n);
		int temp = n;
		while(temp) {
			temp /= 10;
			p++;
		}
		temp = n;
		while(temp) {
			sum += pow(temp % 10, p);
			temp /= 10;
		}
		if(sum == n)
			printf("T\n");
		else
			printf("F\n");
	}
	return 0;
}
2024/6/15 08:44
加载中...