摘要: while (true) //输入年月日判断是该年的第几天 { int year, mooth, day; Console.Write("请输入年份:"); year=int.Pars... 阅读全文
posted @ 2015-11-03 09:47 默认lz 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 枚举:常量组常量:变量前面加const函数:修饰符 返回值 函数名(形参1,形参2,...形参N){ 函数体}当一个流程完全封闭,完整的时候,并且需要多次使用的时候才去写函数写在main函数外面,class里面无返回值无参数有返回值,无参数的有返回值 有参数的有多个返回值的 阅读全文
posted @ 2015-11-03 09:43 默认lz 阅读(166) 评论(0) 推荐(0) 编辑
摘要: class Program { //定义一个结构体 struct student//student就是我们自己造的新数据类型 { public int code;//public修饰符 public str... 阅读全文
posted @ 2015-11-03 09:42 默认lz 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 结构体:用户自定义数据类型,实际就是变量组,可以一次存多个不同变量结构体定义在main函数外面struct 结构体名{ //元素一 //元素二} 阅读全文
posted @ 2015-11-03 09:39 默认lz 阅读(147) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //数组:有固定长度的同种类型的一组变量,有索引,索引从0开始 int[] shuzu = new int[5] { 2, 4, 5, 7, 9 }; ... 阅读全文
posted @ 2015-11-03 09:31 默认lz 阅读(168) 评论(0) 推荐(0) 编辑
摘要: try { //要包括起来的可能有错误的代码 } catch (Exception ex)//抓获错误 { throw ex; }... 阅读全文
posted @ 2015-11-03 09:27 默认lz 阅读(109) 评论(0) 推荐(0) 编辑
摘要: for (int k = 1; k <= 100; k++) { int count = 0; for (int i = 1; i <= k; i++) { ... 阅读全文
posted @ 2015-11-03 09:21 默认lz 阅读(176) 评论(0) 推荐(0) 编辑
摘要: int sum = 0; Console.Write("请输入数字:"); int shu = int.Parse(Console.ReadLine()); for (int i = 1; i <= shu; i++) ... 阅读全文
posted @ 2015-11-03 09:18 默认lz 阅读(132) 评论(0) 推荐(0) 编辑
摘要: int renying = 0; int dnying = 0; for (int i = 1; i = 2) { Console.WriteLine("三局两胜人赢了"); } ... 阅读全文
posted @ 2015-11-03 09:15 默认lz 阅读(132) 评论(0) 推荐(0) 编辑