import java.util.Scanner; // dev branch for Y.Practicum public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int people; System.out.println("ÐобÑÑй денÑ! Ðа ÑколÑко лÑдей надо ÑазделиÑÑ ÑÑÑÑ?"); while(true) { if (scanner.hasNextInt()) { people = scanner.nextInt(); if (people == 1) { System.out.println("ÐведиÑе колиÑеÑÑво лÑдей болÑÑе одного:"); } if (people < 1) { System.out.println("ÐведиÑе коÑÑекÑное колиÑеÑÑво лÑдей:"); } if (people > 1){ break; } } else { System.out.println("ÐожалÑйÑÑа, введиÑе колиÑеÑÑво лÑдей, иÑполÑзÑÑ ÑиÑло:"); scanner.nextLine(); } } Calculate.calculate(); double personMoney = Calculate.allPrice / people; String tempPrice = "ÐÑего ÑÑмма: %.2f"; String tempPerson = "Ðа каждого Ñеловека: %.2f"; System.out.println("ÐобавленнÑе ÑоваÑÑ:\n" + Calculate.allItem); System.out.println("ÐÑего лÑдей: " + people); System.out.println(String.format(tempPrice, Calculate.allPrice) + " " + Format.GetRuble(Calculate.allPrice)); System.out.println(String.format(tempPerson, personMoney) + " " + Format.GetRuble(personMoney)); } }