很特別的主題
namespace MVATwentyQuestions { class Program { static void Main(string[] args) { bool result = false; result = CheckPowerOfTwo(8); Console.WriteLine(result.ToString()); } static bool CheckPowerOfTwo(ulong number) { return (number != 0) && ((number & (number - 1)) == 0); } } }
沒有留言:
張貼留言