-
Notifications
You must be signed in to change notification settings - Fork 0
Comments
Conversation
src/main/java/Main.java
Outdated
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.
Для каждого класса свой файл?
src/main/java/Main.java
Outdated
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.
Твой код можно оптимизировать, и вместо if else if else использовать switch case
`String[] rubForms = {"Рубль", "Рублей", "Рубля"};
int mod = (int)(d % 100);
int res = (mod > 19) ? (mod % 10) : mod;
switch (res) {
case 1:
return rubForms[0];
case 2:
case 3:
case 4:
return rubForms[2];
default:
return rubForms[1];
}`
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.
и лучше Рубль сделать с маленькой буквы
Подсчет суммы оплаты для каждого человека с учетом остатка при делении.