我哪里错了?

题目总版

SDXpanyang @ 2025-01-10 22:29:59

我哪里错了?

#include<bits/stdc++.h>
using namespace std;
long long a[25];
int n;
int antn(long long x){
    int ant=0;
    while(x){
        ant+=x%10;
        x/=10;
    }
    return ant;
}
int sumn(long long x){
    x*=7;
    while(x>9)x=antn(x);
    return x;
}
bool dif(long long x){
    int ans=0;
    for(int i=1;x;i++,x/=10){
        if(i&1)ans+=sumn(x%10);
        else ans+=x;
    }
    return !(ans%8);
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        cout<<(dif(a[i])?"T\n":"F\n");
    }
    return 0;
}

求救!


by lzx111218 @ 2025-01-10 22:32:10

你倒是说哪题啊


by LuZhuti @ 2025-01-10 22:37:47

@SDXpanyang


by SDXpanyang @ 2025-01-10 23:01:28

B3850


by SDXpanyang @ 2025-01-10 23:03:17

我会了!


by SDXpanyang @ 2025-01-10 23:06:36

我会了!

我会了!


|