1 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int a; cin>>a; int a1=a; int cnt=0;//当前a的位数 while(a1) { cnt++; a1/=10; } int s=0; //当前每位的cnt次方的和 a1=a; while(a1) { int ge=a1%10; s=s+pow(ge,cnt); a1/=10; } if(s==a) { cout<<"T"<<endl; } else { cout<<"F"<<endl; } } return 0; }
Information
- ID
- 1176
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 53
- Accepted
- 11
- Uploaded By