From f13d86e5d4abc0edaff6c6b96e5d76337a0fbf61 Mon Sep 17 00:00:00 2001 From: kamyu Date: Sun, 18 Sep 2016 22:45:38 +0800 Subject: [PATCH] Update nth-digit.cpp --- C++/nth-digit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C++/nth-digit.cpp b/C++/nth-digit.cpp index c30adbf0b..afe69e929 100644 --- a/C++/nth-digit.cpp +++ b/C++/nth-digit.cpp @@ -6,7 +6,7 @@ class Solution { int findNthDigit(int n) { int digit_len = 1; while (n > digit_len * 9 * pow(10, digit_len - 1)) { - n -= digit_len * 9 * pow(10, digit_len - 1); + n -= digit_len * 9 * pow(10, digit_len - 1); ++digit_len; }