chore: improved naming once more
This commit is contained in:
parent
a331c81620
commit
6263ad75a8
1 changed files with 10 additions and 10 deletions
20
main.cpp
20
main.cpp
|
@ -30,25 +30,25 @@ int main()
|
||||||
const int middle_digit = ((middle_and_right_digit) - right_digit) / 10;
|
const int middle_digit = ((middle_and_right_digit) - right_digit) / 10;
|
||||||
|
|
||||||
vector<string> result;
|
vector<string> result;
|
||||||
string number_construction = "";
|
string number_constructor = "";
|
||||||
if (middle_and_right_digit < 11 || middle_and_right_digit > 12)
|
if (middle_and_right_digit < 11 || middle_and_right_digit > 12)
|
||||||
{
|
{
|
||||||
// Handle everything else
|
// Handle everything else
|
||||||
if (right_digit == 1)
|
if (right_digit == 1)
|
||||||
number_construction = "s";
|
number_constructor = "s";
|
||||||
if (middle_digit > 1 && right_digit != 0)
|
if (middle_digit > 1 && right_digit != 0)
|
||||||
number_construction = "und";
|
number_constructor = "und";
|
||||||
number_construction = first_digit_strings[right_digit] + number_construction;
|
number_constructor = first_digit_strings[right_digit] + number_constructor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Handle 11 and 12
|
// Handle 11 and 12
|
||||||
if (middle_and_right_digit == 11)
|
if (middle_and_right_digit == 11)
|
||||||
number_construction = "elf";
|
number_constructor = "elf";
|
||||||
else
|
else
|
||||||
number_construction = "zwoelf";
|
number_constructor = "zwoelf";
|
||||||
}
|
}
|
||||||
result.push_back(number_construction);
|
result.push_back(number_constructor);
|
||||||
|
|
||||||
if ((input > 9 /*input_length > 1*/) && (middle_and_right_digit < 11 || middle_and_right_digit > 12))
|
if ((input > 9 /*input_length > 1*/) && (middle_and_right_digit < 11 || middle_and_right_digit > 12))
|
||||||
result.push_back(middle_digit_strings[middle_digit]);
|
result.push_back(middle_digit_strings[middle_digit]);
|
||||||
|
@ -59,10 +59,10 @@ int main()
|
||||||
{
|
{
|
||||||
int left_digit = ((input % 1000) - middle_digit) / 100;
|
int left_digit = ((input % 1000) - middle_digit) / 100;
|
||||||
if (left_digit != 1)
|
if (left_digit != 1)
|
||||||
number_construction = first_digit_strings[left_digit];
|
number_constructor = first_digit_strings[left_digit];
|
||||||
else
|
else
|
||||||
number_construction = "";
|
number_constructor = "";
|
||||||
result.push_back(number_construction + "hundert");
|
result.push_back(number_constructor + "hundert");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result.push_back("");
|
result.push_back("");
|
||||||
|
|
Loading…
Reference in a new issue