有好心人帮一下忙吗
查看原帖
有好心人帮一下忙吗
587308
yaoxuelin楼主2023/5/9 20:59
#include<bits/stdc++.h>
using namespace std;
int a[] = {1,0,1,0,0,0,1,0,1,2};
int main(){
    string s;
    cin >> s;
    int sum = 0;
    for(auto &i:s){
        sum += a[i - 48];
//        cout << a[i - 48] << endl;
    }
    cout << sum;
    return 0;
}

2023/5/9 20:59
加载中...