public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
int x = 0;
int y = 0;
if (this.age > anotherCat.age)
x++;
else
y++;
if (this.weight > anotherCat.weight)
x++;
else
y++;
if (this.strength > anotherCat.strength)
x++;
y++;
if (x > y )
return true;
if ( x < y )
return false;
if ( x == y )
return false;
//напишите тут ваш код
}
public static void main(String[] args) {
}
}
hidden #2140216
13 уровень
Что не так
Обсуждается
Комментарии (1)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
Ksenia VolkovaJava Developer в DXCMaster
14 октября 2019, 14:43
Соперник получает очки за ничью.
0