Skip to content

Commit f247d62

Browse files
authored
Update number-of-digit-one.cpp
1 parent b82a338 commit f247d62

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

C++/number-of-digit-one.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class Solution {
55
public:
66
int countDigitOne(int n) {
77
static const int DIGIT = 1;
8+
89
int is_zero = (DIGIT == 0) ? 1 : 0;
910
int result = is_zero;
1011
for (int64_t base = 1; n >= base; base *= 10) {

0 commit comments

Comments
 (0)