上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: class Program { struct Player { public string name; public int blood; public int attack; ... 阅读全文
posted @ 2015-07-14 18:28 Franky2015 阅读(211) 评论(0) 推荐(0) 编辑
摘要: class Program { struct Student { public string name; public int age; public double Cshap; pub... 阅读全文
posted @ 2015-07-14 18:25 Franky2015 阅读(796) 评论(0) 推荐(0) 编辑
摘要: 结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样。一、定义的方法:注:结构体一般定义在Main函数的上面,Class下面,作为一个类,参数前面加上public代表公用变量,(也可用protect-受保护的,private-私有的,这2个基本不用)struct student... 阅读全文
posted @ 2015-07-14 18:24 Franky2015 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1.栈:Stack,先进后出,一个一个赋值,一个一个取值,按顺序。.count 取集合内元素的个数.push() 将元素一个一个推入集合中//stack集合存入用.push().pop() 将元素一个个弹出集合.clear() 清空集合 Stack s = new Stack();//先存入的后取出... 阅读全文
posted @ 2015-07-14 17:56 Franky2015 阅读(217) 评论(0) 推荐(1) 编辑
摘要: 1.添加元素,读取ArrayList n = new ArrayList(); n.Add(1);//集合中添加元素用Add,分别添加了1,2 n.Add(2); foreach (int a in n)//用foreach循环语句读... 阅读全文
posted @ 2015-07-14 17:39 Franky2015 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 常用的集合是ArryList类,数组是连续的、同一类型的一块区域,而集合是可以不连续的、多种数据类型的。获取数组的元素是使用Length属性,而获取ArrayList集合的元素是使用count属性数组可以有多维,而ArrayList集合只能是一维使用集合前:首先在命名空间添加Using System... 阅读全文
posted @ 2015-07-14 17:26 Franky2015 阅读(526) 评论(0) 推荐(0) 编辑
摘要: //定义地图 #region 定义地图 int x=6; int y=1; //人的初始坐标 int a=6; int b=3; //箱子的初始坐标 int[,] map = new int[10, 10] {... 阅读全文
posted @ 2015-07-14 15:56 Franky2015 阅读(485) 评论(0) 推荐(0) 编辑
摘要: nt[] tp = new int[20]; //每个人投的票 int [] ps = new int[5]; //每个候选人所得票数 for (int i = 0; i < tp.Length; i++) { ... 阅读全文
posted @ 2015-07-09 23:04 Franky2015 阅读(1145) 评论(0) 推荐(0) 编辑
摘要: Console.WriteLine("请输入分数的个数:"); int a = Convert.ToInt32(Console.ReadLine()); int [] fs = new int [a]; if (a < 5) ... 阅读全文
posted @ 2015-07-09 23:02 Franky2015 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 手机号排序 Console.WriteLine("请输入手机号的个数:"); int a = Convert.ToInt32(Console.ReadLine()); string[] sj = new string[a]; for ... 阅读全文
posted @ 2015-07-09 22:57 Franky2015 阅读(187) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页