ソースコード public static class IntExtensions { /// <summary> /// 奇数かどうかを返します /// </summary> public static bool IsOdd( this int self ) { return self % 2 == 1; } } 使い方 int n1 = 1; int n2 = 2; n1.IsOdd(); // True n2.IsOdd(); // False
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。