Problem1132--统计个位数字

1132: 统计个位数字

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现一个函数,可统计任一整数中某个位数出现的次数。例如-21252中,2出现了3次,则该函数应该返回3。 函数接口定义: int Count_Digit ( const int N, const int D ); 其中N和D都是用户传入的参数。N的值不超过int的范围;D是[0, 9]区间内的个位数。函数须返回N中D出现的次数。 裁判测试程序样例: #include int Count_Digit ( const int N, const int D ); int main() { int N, D; scanf(

Input

N的值不超过int的范围;D是[0, 9]区间内的个位数

Output

N的值不超过int的范围;D是[0, 9]区间内的个位数

Sample Input Copy

-21252 2

Sample Output Copy

3

Source/Category