日期:2014-05-17 浏览次数:20803 次
using System; class App { public static Int32 _Signin; public static Int32 GetSignin(Byte index) { return (Byte)(_Signin >> index & 1); } public static void SetSignin(Byte index, Byte value) { if (value > 0) { _Signin = 1 << index | _Signin; } else { _Signin = ~(1 << index) & _Signin; } } static void Main() { for (Byte i = 0; i < 31; i++) { SetSignin(i, (Byte)(i % 2 == 0 ? 1 : 0)); } for (Byte i = 0; i < 31; i++) { Console.WriteLine(GetSignin(i)); } Console.ReadKey(); } }