摘要: class Program { struct student //定义一个student的结构体 { public string name; //基本格式 public int code; public int age; public int fenshu; } static void Main(... 阅读全文
posted @ 2015-04-16 22:11 zhenximeiyitian 阅读(283) 评论(0) 推荐(0) 编辑
摘要: while (true) { Console.Write("请输入一个时间(24小时制):"); //string s = Console.ReadLine(); int hour = Convert.ToInt32(Console .ReadLine ()); if(hour >= 0 && h... 阅读全文
posted @ 2015-04-16 21:54 zhenximeiyitian 阅读(232) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { // 本月的成兔=上月的小兔+上月的成兔 // 本月的小兔=上月的小兔 // 本月的幼兔=本月的成兔 Console.WriteLine("请输入月数:"); int m = Convert.ToInt32(Console.R... 阅读全文
posted @ 2015-04-16 21:35 zhenximeiyitian 阅读(1389) 评论(0) 推荐(0) 编辑
摘要: while (true) { Random r=new Random();//定义随机数 int a=r.Next(1,10); //定义一个千位数 int b = r.Next(1,10); //定义一个百位数 int c = r.Next(1,b);//再定义一个百位数 Console.Wr... 阅读全文
posted @ 2015-04-16 20:34 zhenximeiyitian 阅读(218) 评论(0) 推荐(0) 编辑
摘要: c#是微软公司在2000年7月发布的一种全新且简单、安全、面向对象的程序设计语言,是专门为.NET的应用而开发的语言。.NET框架为c#提供了一个强大的、易用的、逻辑结构一致的程序设计环境。函数的四要素:名称,输入,输出,加工namespace ConsoleApplication1 命名空间cla... 阅读全文
posted @ 2015-04-16 13:50 zhenximeiyitian 阅读(261) 评论(0) 推荐(0) 编辑
摘要: int[,] map = new int[10, 10] //定义一个二维数组,十行十列 { {1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,0,1,0,0,1}, {1,0,2,0,0,0,1,0,0,1}, {1,0,0,0,0,0,1,0,0,1}, {1,0,0,0,0... 阅读全文
posted @ 2015-04-16 12:53 zhenximeiyitian 阅读(615) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { int n = 1; while (n < 6) //在括号内直接限制循环条件 { Console.WriteLine( "打印结果{0},{1}",n,2*n); n = n + 1; //需要在中括号内给出改变方式,否则将进入... 阅读全文
posted @ 2015-04-16 10:12 zhenximeiyitian 阅读(104) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { ArrayList al = new ArrayList(); Console.Write("请输入人数"); int n = Convert.ToInt32(Console.ReadLine()); for (int i = 0... 阅读全文
posted @ 2015-04-16 10:09 zhenximeiyitian 阅读(154) 评论(0) 推荐(0) 编辑