Skip to content

Практическая работа 1#2

Open
Averkieva wants to merge 4 commits intomainfrom
master
Open

Практическая работа 1#2
Averkieva wants to merge 4 commits intomainfrom
master

Conversation

@Averkieva
Copy link
Copy Markdown
Owner

No description provided.

Scanner scanner = new Scanner(System.in);
System.out.println("На сколько человек нужно разделить счет?");
int countOfPeople;
while(1==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.

Можно просто написать while(true) и цикл тоже будет бесконечный

@@ -0,0 +1,12 @@
public class correctWriting {
public static String WritingRub(int countOfRub){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

название методов(функций) согласно CodeStyles должны быть с маленькой буквы, а вот названия классов наоборот с большой

String str;
if (countOfRub % 10 > 1 && countOfRub % 10 <=4)
str = "рубля";
else if (countOfRub % 10 == 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.

если countOfRub будет 111, то окончание выведется неверное

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