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 = "";