1 solutions

  • 1
    @ 2026-2-24 16:02:35
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	while(n--)
    	{
    		int x;
    		cin>>x;
    		int t=x;
    		int cnt=0;
    		while(t)
    		{
    			cnt++;
    			t/=10;
    		}
    		t=x;
    		int sum=0;
    		while(t)
    		{
    			int ge=t%10;
    			sum=sum+pow(ge,cnt);
    			t/=10;
    		}
    		if(sum==x)
    		{
    			cout<<"T"<<endl;
    		}
    		else
    		{
    			cout<<"F"<<endl;
    		}
    	}
    	return 0;
    }
    
    
    • 1

    Information

    ID
    1176
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    118
    Accepted
    25
    Uploaded By