代码不知道该怎么累加,很迷
供参考:
#include<stdio.h>
#include<string.h>
int main()
{
char s[200];
int i=0,A=0,B=0;
while((gets(s)) != NULL)//ctrl+z 结束输入
{
i=0;A=0;B=0;
while(s[i])
{
if(s[i]=='0' || s[i]=='6' || s[i]=='9')
A++;
else if(s[i]=='8')
B++;
i++;
}
printf("%d\n",A+2*B);
}
return 0;
}
“4”也算“圆”圈吧,
虽然“丩”不算。