0分求助 dev里测没问题

B2068 统计满足条件的 4 位数

peter_p_r @ 2024-07-19 16:57:24

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,ge,shi,bai,qian;
    cin>>a;
    for(int i=1;i<=a;i++){
        cin>>b;
        ge=b%10;
        shi=b/10%10;
        bai=b/100%10;
        qian=b/1000;
        if((ge-qian-bai-shi)>0){
            c++;
        }
    }
    cout<<c;
    return 0;
}

by xxgirlxx @ 2024-07-19 17:08:48

@peter_p_r

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c=0,ge,shi,bai,qian;
    cin>>a;
    for(int i=1;i<=a;i++){
        cin>>b;
        ge=b%10;
        shi=b/10%10;
        bai=b/100%10;
        qian=b/1000;
        if((ge-qian-bai-shi)>0){
            c++;
        }
    }
    cout<<c;
    return 0;
}

by peter_p_r @ 2024-07-19 17:17:32

谢谢joker已解决


by jinrunsen @ 2024-09-01 13:39:59

@peter_p_r 你直接说人家joker不好


|