import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
double totalSum = 0;
String answer;
String answer1 = "ÐавеÑÑиÑÑ";
ArrayList plates = new ArrayList<>();
String plateName;
double platePrice;
String ruble = "";
Scanner scanner = new Scanner(System.in);
System.out.println("Ðа ÑколÑкиÑ
Ñеловек необÑ
одимо ÑазделиÑÑ ÑÑеÑ?");
int countOfPersons = scanner.nextInt();
if (countOfPersons <= 1) {
System.out.println("ÐÑ Ð²Ð²ÐµÐ»Ð¸ недопÑÑÑимое ÑиÑло полÑзоваÑелей");
System.out.println("ÐведиÑе колиÑеÑÑво гоÑÑей еÑе Ñаз, пожалÑйÑÑа : ");
} else {
while (true) {
System.out.println("ÐведиÑе название ÑоваÑа: ");
plateName = scanner.next();
plates.add(plateName);
System.out.println(plateName + " ÑÑпеÑно добавлен к заказÑ.");
System.out.println("ÐобавленнÑе ÑоваÑÑ: " + plateName);
System.out.println("ÐведиÑе ÑÐµÐ½Ñ ÑоваÑа: ");
platePrice = scanner.nextDouble();
totalSum += platePrice;
System.out.println("ХоÑиÑе завеÑÑиÑÑ Ð·Ð°ÐºÐ°Ð·? ");
answer = scanner.next();
if (answer.equalsIgnoreCase(answer1))
break;
}
System.out.println("ÐобавленнÑе ÑоваÑÑ: " + plates);
if ((Math.floor(totalSum / countOfPersons) / 10) == 1) {
ruble = "ÑÑблÑ";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 2) {
ruble = "ÑÑблÑ";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 3) {
ruble = "ÑÑблÑ";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 4) {
ruble = "ÑÑблÑ";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 5) {
ruble = "ÑÑблей";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 6) {
ruble = "ÑÑблей";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 7) {
ruble = "ÑÑблей";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 8) {
ruble = "ÑÑблей";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 9) {
ruble = "ÑÑблей";
} else if ((Math.floor(totalSum / countOfPersons) / 10) == 0) {
ruble = "ÑÑблей";
}
System.out.printf("РоплаÑе Ñ Ñеловека: " + (Math.floor(totalSum / countOfPersons) + ruble));
}
}
}