1 条题解

  • 1
    @ 2026-3-7 13:07:09
    #include<bits/stdc++.h>
    using namespace std;
    const int N=1e3+10;
    int n;
    long long h;
    int ac(int y,int x){
    	if(x%2==0)
            return y;
        y*=7;
        while(y>9){
            int temp=y,cnt=0;
            while(temp!=0){
                cnt+=temp%10;
                temp/=10;
            }
            y=cnt;
        }
        return y;
    }
    bool AC(long long x){
    	long long sum=0,i=1;
    	while(x!=0){
            sum+=ac(x%10,i);
            x/=10;
            i++;
    	}
    	if(sum%8==0)
    	    return true;
    	else return false;
    }
    int main()
    {
        cin>>n;
        for(int i=0;i<n;i++){
        	cin>>h;
        	if(AC(h))
        	    cout<<'T'<<endl;
        	else cout<<'F'<<endl;
    	}
    	return 0;
    }
    

    信息

    ID
    3456
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    递交数
    13
    已通过
    7
    上传者