1 solutions

  • 1
    @ 2025-5-24 14:33:52
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int t;
    	cin>>t;
    	while(t--)
    	{
    		long long n;
    		cin>>n;
    		int res=0;
    		int cnt=1;
    		while(n) //拆数 
    		{
    			int ge=n%10;  //得到个位 
    			if(cnt%2==0)  //第偶数个数 
    			{
    				res+=ge;	
    			}	
    			else 		  //第奇数个数 
    			{
    				ge=ge*7;  //按照题目模拟过程 
    				while(ge>=10)
    				{
    					ge=ge%10+ge/10;
    				} 
    				res+=ge;
    			}
    			n/=10;  //删除最低位 
    			cnt++;  //计算下一位 
    		}	
    		if(res%8==0) //判断结果 
    		{
    			cout<<"T"<<endl;
    		}
    		else
    		{
    			cout<<"F"<<endl;
    		}
    	}	
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2522
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    6
    Accepted
    3
    Uploaded By