日期:2014-05-18 浏览次数:21153 次
public static int TwoToTen(string num2) { int num10 = 0; for (int i = 0; i < num2.Length; i++) { num10 += (int)Math.Pow(2, i) * Convert.ToInt32(num2.Substring(num2.Length - i - 1, 1)); } return num10; }
------解决方案--------------------
int a = 207;
string s = Convert.ToString(a, 2);
输出s
------解决方案--------------------