int Count_Digit ( const int N, const int D )
{
int i,j,k;
int count=0;
if(N==0)
return 1;
else if(N<0)
j=-N;
else
j=N;
while(j) {
i=j%10;
if(i==D)
count++;
j/=10;
}
return count;
}
6-3 统计个位数字 (15分)
最新推荐文章于 2022-06-02 00:53:08 发布