60求教
查看原帖
60求教
1773513
nongshenzhe楼主2025/7/20 10:12
#include <bits/stdc++.h> 
using namespace std;
int main (){
	int X,g,z=0;
	cin>>X;
	while(X!=0){
		g=X%10;
        X/=10;
		if(g==2||g==6||g==9||g==0){
			z+=1;	
		} 
		if(g==8){
			z+=2; 
		}
	}
	cout<<z;
}
2025/7/20 10:12
加载中...