2007年8月30日

C#小游戏-------猜数字(转载)

摘要: 学习任何的语言,都是在不断的编写中提高了.勿以简小而不为.using System; public class Game { private string number; private static int x,y; private int count=0; public void init() { do{ Console.WriteLine("Please input number:"); number=(string)Console.ReadLine(); }while(number.Length!=4); } public void play() { string ready="1234"; 阅读全文

posted @ 2007-08-30 18:17 9who 阅读(569) 评论(0) 推荐(0) 编辑

csc编译环境的设置

摘要: 安装完.net之后,进入dos运行csc会提示你是 不可运行的程序,这时你对csc设置全局环境变量,当然不设置夜可以,在安装之后的目录有一个visual studio 2005命令提示符,是可以运行的。 如何设置全局环境变量 如果你安装了 .NET Framework,csc.exe 可以在这个位置找到: \WINDOWS\Microsoft.NET\Framework\v**** 默认情况... 阅读全文

posted @ 2007-08-30 17:41 9who 阅读(528) 评论(0) 推荐(0) 编辑

微软智力题——三个灯泡

摘要: 这是一道微软用来测试应聘者的试题。它主要考察受训者的逻辑思维和判断能力,同 时也给受训者一些关于问题解决方法上的启示。 游戏规则和程序 1.有两个房间,一间房里有三盏灯,另一间房有控制着三盏灯的三个开关,这两个房间是 分割开的,从一间里不能看到另一间的情况。 2.现在要求受训者分别进这两房间一次,然后判断出这三盏灯分别是由哪个开关控制的。 3.有什么办法呢? 相关讨论 ... 阅读全文

posted @ 2007-08-30 17:21 9who 阅读(1392) 评论(0) 推荐(0) 编辑

C#算法-------(四)快速排序(转载)

摘要: using System; namespace QuickSorter { public class QuickSorter { private void Swap(ref int l,ref int r) { int s; s=l; l=r; r=s; } public void Sort(int [] list,int low,int high) ... 阅读全文

posted @ 2007-08-30 17:17 9who 阅读(296) 评论(0) 推荐(0) 编辑

C#算法----(三)希尔排序(转载)

摘要: using System; public class ShellSorter { public void Sort(int [] list) { int inc; for(inc=1;inc0;inc/=3) { for(int i=inc+1;iinc)&&(list[j-inc-1]>t)) { ... 阅读全文

posted @ 2007-08-30 17:16 9who 阅读(202) 评论(0) 推荐(0) 编辑

C#算法----(二)插入排序 (转载)

摘要: 朋友们,我最近加紧写C#的一些算法。选择排序已经推出的。现推出插入算法。 对想提高C#语言编程能力的朋友,我们可以互相探讨一下。 如:下面的程序,并没有实现多态,来,帮它实现一下。 using System; public class InsertionSorter { public void Sort(int [] list) { for(int i=1;i0)&&(list... 阅读全文

posted @ 2007-08-30 17:16 9who 阅读(243) 评论(0) 推荐(0) 编辑

c#.net常用的小函数和方法集

摘要: 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=currentTime.Day; 1.5 取当前时 int 时=currentTime.Hour; 1.6 取当前分 int 分=currentTime.Minute; 1.7 取当前秒 int 秒=currentTime.Second; 1.8 取当前毫秒 br 阅读全文

posted @ 2007-08-30 16:54 9who 阅读(226) 评论(0) 推荐(0) 编辑

导航