#include <stdio.h>
int Count_Digit ( const int N, const int D );
int main()
{
int N, D;
scanf("%d %d", &N, &D);
printf("%d\n", Count_Digit(N, D));
return 0;
}
int Count_Digit ( const int N, const int D )
{
int i,n;
if(N>0) n=N;
else if(N<0)
n=-N;
while(n>0){
if(n%10==D)
i++;
n=n/10;
}
return i;
}
PAT基础编程习题集 4-9 统计个位数字
最新推荐文章于 2022-04-20 10:11:12 发布