题解 | #游游的数字圈#
游游的数字圈
https://www.nowcoder.com/practice/16eafa41a4a242b8870cb2c5420ae089
#include <iostream> using namespace std; int main() { int sum=0; string s; cin>>s; for(int i=0;i<s.size();++i) { if(s[i]=='0'||s[i]=='6'||s[i]=='9') sum+=1; else if(s[i]=='8') sum+=2; else sum=sum; } cout<<sum; return 0; } // 64 位输出请用 printf("%lld")