Добрый день! Что может не нравится валидатору (по вем 3 пунктам)? В Idea все выводится....
package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(1)
*/
public class Solution {
public static class Cat {
//напишите тут ваш код
private String name;
private int age;
private int weight;
private int strength;
public Cat(String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
int ageScore = Integer.compare(this.age, anotherCat.age);
int weightScore = Integer.compare(this.weight, anotherCat.weight);
int strengthScore = Integer.compare(this.strength, anotherCat.strength);
int score = ageScore + weightScore + strengthScore;
if (score > 0) {
System.out.println("Победа");
return true;
} else if (score < 0) {
System.out.println("Поражение");
return false;
} else {
System.out.println("Ничья");
return false;
}
}
public static void main(String[] args) {
Cat cat1 = new Cat("Васька", 1, 1, 1);
Cat cat2 = new Cat("Борька", 1, 1, 1);
Cat cat3 = new Cat("Тишка", 2, 4, 8);
cat1.fight(cat2);
cat2.fight(cat3);
cat3.fight(cat1);
}
}
}