用求一个数的个位数来依次比较
int CountDigit( int number, int digit ) { int conpare,count; if (number <0) { number = number*-1; } while (number >10) { conpare = number %10; number = number/10; if (conpare == digit) count++; } if (number == digit) count++; return count; }