- 【GESP202306C++二级】 自幂数判断
n
- 2025-1-12 15:52:56 @
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,x;
cin>>n;
while(n--){
cin>>x;
int y=x;
int w=0;
while(y>0){
w++;
y/=10;
}
y=x;
int sumn=0;
while(y>0){
sumn+=pow(y%10,w);
y/=10;
}
if(sumn==x) cout<<"T\n";
else cout<<"F\n";
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 2544
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 21
- Accepted
- 10
- Uploaded By