1 条题解

  • 0
    @ 2025-12-7 0:56:18
    #include <bits/stdc++.h>
    using namespace std;
    
    bool chk(int n){
        int sum=0;
        while(n){
            sum+=n%10;
            n/=10;
        }
        if(sum%7==0) return true;
        else return false;
    }
    int main(){
         int n,t;
         cin >> n;
         while(n--){
            cin >> t;
            //
            if(chk(t)==true) cout << "Yes" << endl;
            else cout << "No" << endl;
         }
         return 0;
    }
    
    • 1

    数位之和(洛谷 B4036)(循环输入+循环数位拆分)

    信息

    ID
    610
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    (无)
    递交数
    66
    已通过
    12
    上传者