摘要: declare @i intdeclare @sum intset @i=1set @sum=0while @i<=100begin set @sum=@sum+@i set @i=@i+1endprint @sumif 1=10 print '对'else if 2=2 print '对错'else print '错'declare @today intdeclare @week nvarchar(3)set @today=25set @week= case when @today=1 then '星期一' when @t 阅读全文
posted @ 2013-04-24 23:00 lhfly 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 猫大叫一声,所有的老鼠都开始逃跑,主人被惊醒。(C#语言) 1.要有联动性,老鼠和主人的行为是被动的。 2.考虑可扩展性,猫的叫声可能引起其他联动效应。 public interface Observer { void Response();//观察者响应 } public interface Subject { void AimAt(Observer obs); //针哪些观察者 } public class Mouse : Observer { private string name; p... 阅读全文
posted @ 2013-04-24 22:55 lhfly 阅读(442) 评论(0) 推荐(0) 编辑