听取WA声一片 40分
查看原帖
听取WA声一片 40分
1192648
LHX_18460366315楼主2024/5/5 12:12
#include<bits/stdc++.h>
using namespace std;
int main(){
	string x;
	cin >> x;
	int xlen = x.size(),cnt = 0;
	for (int i = 0;i < xlen;i++){
		if (x[i] == '2' || x[i] == '6' || x[i] == '9') cnt++;
		else if (x[i] == '8') cnt += 2; 
	}
	cout << cnt;
    return 0;
}

2024/5/5 12:12
加载中...