Skip to content

Коммит первой работы - #1

Open
Evlenium wants to merge 3 commits into
mainfrom
FirstExample
Open

Evlenium wants to merge 3 commits into
mainfrom
FirstExample

Conversation

@Evlenium

Copy link
Copy Markdown
Owner

Новый вариант

Comment thread src/main/java/Main.java Outdated
calculateIt();
}
public static void calculateIt (){
int human=-1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Почему -1? 0 тоже не валидное значение

Comment thread src/main/java/Main.java Outdated
}
else{
userInput = scanner.nextInt();
if(userInput==1||userInput<1){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно заменить на userInput <= 1

Comment thread src/main/java/Main.java Outdated
userInput = scanner.nextInt();
if(userInput==1||userInput<1){
System.out.println("Число людей должно быть больше одного");
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Студия подсвечивает подсказку, что continue не используется и его можно удалить
image

Comment thread src/main/java/Thing.java Outdated
}
else{
price = scanner.nextFloat();
if(price<0){

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants