Π Ρ Π΅Π΅ ΠΠ ΠΠΠΠ£.ΠΠΎΠΌΠΎΠ³ΠΈΡΠ΅ ΠΏΠΎΠΆΠ°Π»ΡΠΉΡΡΠ°
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 myCetcount=0;
int anotherCatcount=0;
if(this.age>anotherCat.age)
myCetcount++;
else
anotherCatcount++;
if(this.weight>anotherCat.weight)
myCetcount++;
else
anotherCatcount++;
if(this.strenght>anotherCat.strenght)
myCetcount++;
else
anotherCatcount++;
if (anotherCatcount>myCetcount)
return false;
else
return true;//Π½Π°ΠΏΠΈΡΠΈΡΠ΅ ΡΡΡ Π²Π°Ρ ΠΊΠΎΠ΄
}
public static void main(String[] args) {
}
}