计算在区间1到n的所有整数中,数字x(0<=x<=9)共出现多少次
例如:在1到11之间,即在1~11之间,数字1出现了4次。
输入两个整数,第一个数为n的值,第二个为x的值。
输入:11 1
输出:4
#include <iostream>
using namespace std;
int count(int num,int x){
int count=0
计算在区间1到n的所有整数中,数字x(0<=x<=9)共出现多少次
例如:在1到11之间,即在1~11之间,数字1出现了4次。
输入两个整数,第一个数为n的值,第二个为x的值。
输入:11 1
输出:4
#include <iostream>
using namespace std;
int count(int num,int x){
int count=0