import java.util.Scanner; public class Check { Scanner sc = new Scanner(System.in); int friendsCheck; public int readFriendsCount(){ System.out.println("УкажиÑе ÑиÑло на ÑколÑÐºÐ¸Ñ Ð»Ñдей ÑазделиÑÑ ÑÑеÑ?"); while (true){ if (sc.hasNextInt()) { friendsCheck = sc.nextInt(); }else {sc.next();} if (friendsCheck > 1) { break; } else System.out.println("УкажиÑе ÑиÑло и оно должно бÑÑÑ Ð±Ð¾Ð»ÑÑе 1"); } return friendsCheck; } }