From 3b531d11c5cdf554b3d522002dbd9706c2ed956f Mon Sep 17 00:00:00 2001 From: moonleay Date: Wed, 20 Nov 2024 16:42:41 +0100 Subject: [PATCH] feat: improved digit calc --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index de150c0..a08f942 100644 --- a/main.cpp +++ b/main.cpp @@ -28,8 +28,8 @@ int main() // TODO: remove static_cast int input_length = static_cast(std::to_string(input).length()); int first_digit = input % 10; - int middle_digit = ((input % 100) - first_digit) / 10; int last_two_digits = input % 100; + int middle_digit = ((last_two_digits) - first_digit) / 10; vector result; string suffix = "";