摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 闰年练习 { class Program { static void Main(string[] args) ... 阅读全文
posted @ 2016-05-14 22:12 枫炎 阅读(774) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 函数阶乘累加和 { class Program { //没有返回值,没有参数 public vo... 阅读全文
posted @ 2016-05-14 22:07 枫炎 阅读(1089) 评论(0) 推荐(0) 编辑
摘要: 函数 定义:一个较大的程序一般分为若干个程序块,每一个模块用来实现一个特定的功能。 所有高级语言里都有子程序这个概念,用子程序实现模块功能。 在c#语言中,子程序的作用是由一个主函数和若干个函数构成 由函数调用其他函数,其他函数也可以相互调用,一个函数可以被一个函数或多个函数调用任意次 作用:在程序 阅读全文
posted @ 2016-05-14 22:05 枫炎 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 枚举(enum)是值类型的一种特殊形式,它从System.Enum继承而来,并为基础类型的值提供替代名称。枚举类型有名称、基础类型和一组字段。基础类型必须是一个除char 类型外的内置的有符号(或无符号)整数类型(如Byte、Int32或UInt64)。也可以说,枚举类型是一组常量的集合。 1、定义 阅读全文
posted @ 2016-05-14 21:58 枫炎 阅读(245) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 变量定义在main函数外面 { class Program { public int a;//变量定义在外面 ... 阅读全文
posted @ 2016-05-14 21:39 枫炎 阅读(855) 评论(0) 推荐(0) 编辑