摘要: //输入十个人的分数,放入集合当中 ArrayList list = new ArrayList(); for(int i = 0;i<10; i++) { int s = int.Parse(Conso... 阅读全文
posted @ 2015-11-23 16:48 小菜鸟。 阅读(123) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Cons... 阅读全文
posted @ 2015-11-23 16:38 小菜鸟。 阅读(169) 评论(0) 推荐(0) 编辑
摘要: //输入全班同学的年龄,按年龄从大到小排列 Console.Write("请输入人数"); int n = int.Parse(Console.ReadLine()); int[] nianling = new int[n]; ... 阅读全文
posted @ 2015-11-23 11:07 小菜鸟。 阅读(203) 评论(0) 推荐(0) 编辑
摘要: //输入十个人的分数,求最高分最低分平均分 int[] fenshu = new int[10]; int max = 0; int min = 0; int sum = 0; ... 阅读全文
posted @ 2015-11-23 11:05 小菜鸟。 阅读(126) 评论(0) 推荐(0) 编辑
摘要: //数组,一组同类型的数据,数组是有长度的,数组有索引的,索引从0开始 //生成随机不重复的6位数彩票 int[] shuzu = new int[7];//定义了一个长度为6的int类型数组 Random r = new Rando... 阅读全文
posted @ 2015-11-23 10:11 小菜鸟。 阅读(293) 评论(0) 推荐(0) 编辑
摘要: //必须通过new初始化变量,后面括号是构造函数 int cuo = 0; Console.WriteLine("请输入时间"); string s = Console.ReadLine(); //datetim... 阅读全文
posted @ 2015-11-23 10:06 小菜鸟。 阅读(145) 评论(0) 推荐(0) 编辑
摘要: try { int a = int.Parse(Console.ReadLine()); } catch (Exception ex) //抓获错误 { ... 阅读全文
posted @ 2015-11-23 09:56 小菜鸟。 阅读(157) 评论(0) 推荐(0) 编辑