摘要:
string num=12num.PadLeft(4, '0'); //结果为为 '0012'看字符串长度是否满足4位,不满足则在字符串左边以"0"补足 阅读全文
摘要:
int[] numbers=new int [20]; //建立一个数组 Random rand=new Random (); //生成随机数 string result=""; //保存结果 for (int i = 0; i < 20; i++) //初始化数组 numbers[i] = i+1; for (int i = 0; i < 20; i++) //洗牌{int temp = rand.Next(20); int tempNumber = numbers[i ]; numbers[i] = numbers[temp ]; numbers[temp] 阅读全文