Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Калькулятор версия 1#1

Open
Kvazarakht wants to merge 1 commit intodev from
dev_Calc_1
Open

Калькулятор версия 1 #1
Kvazarakht wants to merge 1 commit intodev from
dev_Calc_1

Conversation

@Kvazarakht
Copy link
Owner

@Kvazarakht Kvazarakht commented Feb 13, 2024

Добавлен калькулятор заказов

case 2, 3, 4 -> "рубля";
default -> "рублей";
};
double moneyOnePerson = sum / persons;
Copy link

@DmitrijEgorow DmitrijEgorow Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String rubl = switch ((int) sum / persons) {
Зачем дважды выполнять одинаковое деление?

Copy link
Owner Author

@Kvazarakht Kvazarakht Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сакрального смысла нет. Можно перенести объявление переменной перед свичом и использовать ее в качестве параметра.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@DmitrijEgorow DmitrijEgorow DmitrijEgorow left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /