-
Notifications
You must be signed in to change notification settings - Fork 0
Comments
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠ Если будет передано функции 24, то на выходе получим 24,00 рублей.
Снимок экрана 2023年03月13日 201440
Чтобы рассчитать правильное окончание, нужно учесть также остаток от деления на 10. Остаток от 100 стоит проверять в диапазоне чисел от 11 до 19 включительно
Также рекомендую сначала округлить число
double lastNumber = (int) Math.floor(num);
А затем получить остаток
lastNumber % 100; и lastNumber % 10;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно тип сделать int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все правильно. Молодец! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Спасибо!
No description provided.