摘要:
//特殊集合 //stack集合 干草堆 栈集合 //先进后出 一个个的取值 一个一个的赋值,按照顺序进行 //属性与方法 //.count 取集合内元素的个数 //.push() 将元素一个个推入集合中 //.pop() 将元素一个个弹出集合 //.clear() 清空集合 //定义方式 //首先 阅读全文
摘要:
Console.Write("请输入班级人数:"); int n = int.Parse(Console.ReadLine()); //定义集合 ArrayList al = new ArrayList(); double sum = 0; for (int i = 0... 阅读全文
摘要:
Console.Write("请输入班级人数:"); int n = Convert.ToInt32(Console.ReadLine()); ArrayList fenshu = new ArrayList(); double sum = 0; for (int i = 0; i < n;i++ ... 阅读全文
摘要:
//集合 //System.Collections 命名空间包含接口和类,这些接口和类定义的对象(如列表,队列,位数组,哈希表和字典等)集合 //常用的集合为ArrayList类,特殊集合一般用到 Queue,Stack,Hashtable集合 //集合与数组的区别 //1、集合不同于数组,是一组可 阅读全文