Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
EzoeRyou committed Aug 11, 2021
1 parent 72ddd3b commit 0042e81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 008-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ solve(111) ; // solve(11)→solve(1)
111 / 10 ; // 11
~~~

10進数表記は桁が1つ上がると10倍される。だから10で割れば最下位桁が消える。ところで、我々は計算しようとしているのは2進数だ。2進数では桁が1つ上がると2倍される。なので、再帰的に関数`solve`を呼び出して得られた結果は2倍しなければならない。そして足し合わせる。
10進数表記は桁が1つ上がると10倍される。だから10で割れば最下位桁が消える。ところで、我々が計算しようとしているのは2進数だ。2進数では桁が1つ上がると2倍される。なので、再帰的に関数`solve`を呼び出して得られた結果は2倍しなければならない。そして足し合わせる。

~~~cpp
int solve( int n )
Expand Down

0 comments on commit 0042e81

Please sign in to comment.