05 2011 档案

摘要:普通的算法: classProgram{//首先碰到的是这样的一首题目:计算数组{1,1,2,3,5,8.......}第30位值,不用递归,我写出了以下这样的代码staticvoidMain(string[]args){//分析/*第一位不管它,因为第一位是没得加的*第二位是第一位+0*第三位是第二位+第一位*所以我一般的想法是:**/intreturnInt=0;intlastlast=1;intlastInt=1;for(inti=1;i<=30;i++){if(i==1 || i==2){returnInt=1;lastlast=1;lastInt=1;}else{returnI 阅读全文
posted @ 2011-05-11 18:04 小小部落 阅读(220) 评论(0) 推荐(0)
摘要:server publicstaticvoidStart(){Hashtableht=newHashtable();ht["port"]="8899";ht["name"]="Server";ht["authorizedGroup"]="Everyone";GameService.Messge("注册TCP");try{TcpChannelchannel=newTcpChannel(ht,null,null);ChannelServices.Registe 阅读全文
posted @ 2011-05-10 16:24 小小部落 阅读(230) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace test{ public delegate void EventHandler(int i); interface IMethod { void Add(); } class C : IMethod { public void Add() { Console.WriteLine("implements Imethod"); } void aaa() { } } class A { public 阅读全文
posted @ 2011-05-10 16:20 小小部落 阅读(401) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace test{ //猫叫,老鼠逃跑,主人惊醒 class Program { static void Main(string[] args) { Cat c = new Cat("加菲猫"); Mouse m = new Mouse("米老鼠"); Person p = new Person("汤姆"); c.MyEvent += new NumberCha 阅读全文
posted @ 2011-05-10 14:36 小小部落 阅读(254) 评论(0) 推荐(0)