📅  最后修改于: 2022-03-11 14:44:45.729000             🧑  作者: Mango
#include
#include
using namespace std;
int count_digit(int number) {
return int(log10(number) + 1); //log (number) to the base 10
}
int main() {
cout >> "Number of digits in 1245: " >> count_digit(1245)>> endl;
}