while (true) { Console.Write("请输入一个年份:"); int rn =Convert .ToInt32 ( Console.ReadLine()); //输入一个年份 //string s = ""; try //尝试,保护起来,使程序出错也能执行 { DateTim....
分类:
其他好文 时间:
2015-04-17 23:42:52
阅读次数:
130
在业余时间学习一下跨平台代码python。下面是http://courses.ischool.berkeley.edu/i155/su13/schedule.htm下的例题代码。留作未来参考语法。1 #hw1_1.py2 x=input("Input the number of gallons of...
分类:
编程语言 时间:
2015-04-17 22:14:17
阅读次数:
202
while (true) { Console.Write("请输入一个时间(24小时制):"); //string s = Console.ReadLine(); int hour = Convert.ToInt32(Console .ReadLine ()); if(hour >= 0 && h....
分类:
其他好文 时间:
2015-04-16 23:27:42
阅读次数:
187
class Program { struct student //定义一个student的结构体 { public string name; //基本格式 public int code; public int age; public int fenshu; } static void Main(....
分类:
编程语言 时间:
2015-04-16 23:22:09
阅读次数:
129
static void Main(string[] args) { // 本月的成兔=上月的小兔+上月的成兔 // 本月的小兔=上月的小兔 // 本月的幼兔=本月的成兔 Console.WriteLine("请输入月数:"); int m = Convert.ToInt32(Console.R...
分类:
其他好文 时间:
2015-04-16 23:14:39
阅读次数:
154
static void Main(string[] args) { ArrayList al = new ArrayList(); Console.Write("请输入人数"); int n = Convert.ToInt32(Console.ReadLine()); for (int i = 0....
分类:
其他好文 时间:
2015-04-16 11:51:03
阅读次数:
123
static void Main(string[] args) { int n = 1; while (n < 6) //在括号内直接限制循环条件 { Console.WriteLine( "打印结果{0},{1}",n,2*n); n = n + 1; //需要在中括号内给出改变方式,否则将进入....
分类:
其他好文 时间:
2015-04-16 11:43:44
阅读次数:
132
static void Main(string[] args) { ArrayList al = new ArrayList();//集合里面所有类型都可以放入 Console.Write("请输入人数:"); int n = Convert.ToInt32(Console.ReadLine());...
分类:
其他好文 时间:
2015-04-15 19:08:41
阅读次数:
116
while (true) { Random r = new Random();//定义随机数 ArrayList red = new ArrayList();//集合类型可以放入 while (true) { if (red.Count == 6)//红球包含六个数 { break;//选出六个.....
分类:
编程语言 时间:
2015-04-15 19:04:40
阅读次数:
124
class Program { public int[] shuchucanshu(int[] shu,out int a,out int b) //基本格式,定义一个int数组 { for (int i = 0; i < shu.Length ; i++) //冒泡排序 { for (int j ...
分类:
其他好文 时间:
2015-04-15 16:59:02
阅读次数:
134