Вроде все работает, а один пункт не пропускает
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
//напишите тут ваш код
int s1 = 0;
int s2 = 0;
if (this.age > anotherCat.age){
s1++;
}else{
s2++;
}
if (this.weight > anotherCat.weight){
s1++;
}else{
s2++;
}
if (this.strength >= anotherCat.strength){
s1++;
}else{
s2++;
}
if (s1 > s2) {
return true;
}else{
return false;
}
}
public static void main(String[] args) {
Cat s1 = new Cat();
s1.age = 5;
s1.weight = 4;
s1.strength = 3;
Cat s2 = new Cat();
s2.age = 3;
s2.weight = 2;
s2.strength = 1;
System.out.println (s1.fight(s2));
}
}