public class Jitu {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 3; i++) {
System.out.println("请输入头的数量:");
int s1 = sc.nextInt();
System.out.println("请输入脚的数量:");
int s2 = sc.nextInt();
if (s1 < 0 || s2 < 0) {
System.out.println("你的输入有误!你还有" + (2-i) + "次机会输入");
}else {
if (s1 == 0 && s2 == 0) {
System.out.println("鸡兔数量为零");
break;
}else {
int s3;
int s4;
s3 =(4*s1-s2)/2;
s4 =s1-s3;
if (s3 < 0 || s4<0) {
System.out.println("你的答案有问题请重新输入!");