using System;using System.Linq;namespace myjinxin
{publicclassKata{publicboolLearnCharitableGame(int[] arr){var sum = arr.Sum();return sum >0&& sum % arr.Length ==0;}}}
答案2:
using System.Linq;namespace myjinxin
{using System;publicclassKata{publicboolLearnCharitableGame(int[] arr){return arr.Sum()>0&& arr.Sum()% arr.Length ==0;}}}
答案3:
namespace myjinxin {using System.Linq;publicclassKata{publicboolLearnCharitableGame(int[] arr ){if( arr.All( n => n ==0)){returnfalse;}return arr.Sum()%arr.Length ==0;}}}
答案4:
namespace myjinxin
{using System;using System.Linq;publicclassKata{publicboolLearnCharitableGame(int[] arr){int sum = arr.Sum();return sum >0&& sum % arr.Length ==0;}}}
答案5:
namespace myjinxin
{using System.Linq;publicclassKata{publicboolLearnCharitableGame(int[] arr){int sum = arr.Sum();return sum >0&& sum % arr.Length ==0;}}}
简单有趣#131:了解慈善赛【难度:1级】:答案1:using System;using System.Linq;namespace myjinxin{ public class Kata { public bool LearnCharitableGame(int[] arr) { var sum = arr.Su...