namespace myjinxin
{
using System;
using System.Linq;
public class Kata
{
public bool AreEquallyStrong(int yourLeft, int yourRight, int friendsLeft, int friendsRight)
{
int[]yourPower = {yourLeft, yourRight};
int[]friendsPower = {friendsLeft, friendsRight};
return yourPower.Max()==friendsPower.Max() && yourPower.Min()==friendsPower.Min();
}
}
}
答案2:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight)
{
return (YourLeft < YourRight) == (FriendsLeft < FriendsRight)
? YourLeft == FriendsLeft && YourRight == FriendsRight
: YourLeft == FriendsRight && YourRight == FriendsLeft;
}
}
}
答案3:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight){
bool flag;
if(YourLeft == FriendsLeft || YourLeft == FriendsRight || YourRight == FriendsLeft || YourRight == FriendsRight)
flag = YourLeft + YourRight == FriendsLeft + FriendsRight;
else
flag = false;
return flag;
}
}
}
答案4:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int yl, int yr, int fl, int fr)
{
int yw, ys, fw, fs;
if (yl < yr)
{
yw = yl;
ys = yr;
}
else
{
yw = yr;
ys = yl;
}
if (fl < fr)
{
fw = fl;
fs = fr;
}
else
{
fw = fr;
fs = fl;
}
return yw == fw && ys == fs;
}
}
}
答案5:
namespace myjinxin
{
using System;
using System.Linq;
using System.Collections.Generic;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight){
return Math.Max(YourLeft, YourRight)==Math.Max(FriendsLeft, FriendsRight)&&Math.Min(YourLeft, YourRight)==Math.Min(FriendsLeft, FriendsRight);
}
}
}
答案6:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight){
//coding and coding..
if(YourLeft==FriendsLeft&&YourRight==FriendsRight)
{
return true;
}
else if(YourLeft==FriendsRight&&YourRight==FriendsLeft)
{
return true;
}
else return false;
}
}
}
答案7:
namespace myjinxin {
using System;
public class Kata {
public bool AreEquallyStrong( int YourLeft, int YourRight, int FriendsLeft, int FriendsRight ) {
return Math.Max( YourLeft, YourRight ) == Math.Max( FriendsLeft, FriendsRight ) &&
Math.Min( YourLeft, YourRight ) == Math.Min( FriendsLeft, FriendsRight );
}
}
}
答案8:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight){
int yS = Math.Max(YourLeft, YourRight);
int yW = Math.Min(YourLeft, YourRight);
int fS = Math.Max(FriendsLeft, FriendsRight);
int fW = Math.Min(FriendsLeft, FriendsRight);
return yS == fS && yW == fW;
}
}
}
答案9:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int YourLeft, int YourRight, int FriendsLeft, int FriendsRight)
{
return Math.Min(YourLeft, YourRight) == Math.Min(FriendsLeft, FriendsRight) && Math.Max(YourLeft, YourRight) == Math.Max(FriendsLeft, FriendsRight);
}
}
}
答案10:
namespace myjinxin
{
using System;
public class Kata
{
public bool AreEquallyStrong(int a1, int a2, int b1, int b2){
return a1+a2 == b1+b2 && a1*a2 == b1*b2;
}
}
}