feat: improved digit calc

This commit is contained in:
moonleay 2024-11-20 16:42:41 +01:00
parent ae66fc5a37
commit 3b531d11c5
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -28,8 +28,8 @@ int main()
// TODO: remove static_cast // TODO: remove static_cast
int input_length = static_cast<int>(std::to_string(input).length()); int input_length = static_cast<int>(std::to_string(input).length());
int first_digit = input % 10; int first_digit = input % 10;
int middle_digit = ((input % 100) - first_digit) / 10;
int last_two_digits = input % 100; int last_two_digits = input % 100;
int middle_digit = ((last_two_digits) - first_digit) / 10;
vector<string> result; vector<string> result;
string suffix = ""; string suffix = "";