由买买提看人间百态

topics

全部话题 - 话题: ispowerofj
(共0页)
y****9
发帖数: 252
1
[code languages="csharp"]
Func isPowerOfJ = (n, j) =>
{
var power = Math.Log(n, j);
return Math.Floor(power) == power;
};
Func isPowerof3 = (n) => isPowerOfJ(n, 3);
Console.WriteLine(isPowerof3(9));
[/code]
(共0页)