using System;
namespace aaa
{
   public class Time
     {
        private int year;
        private int month;
        private int day;
        private int hour;
        private int minute;
        private int second;
        public Time(System.DateTime now)
          {
              year=now.Year;
              month=now.Month;
              day=now.Day;
              hour=now.Hour;
              minute=now.Minute;
              second=now.Second;
          }
        public int Hour
          {
             get
               {
                  return hour;
               }
             set
               {
                  hour=value;
               }
          }
      public void Display()
         {
            Console.WriteLine("{0}/{1}/{2} {3}:{4}:{5}",month,day,year,hour,minute,second);
         }
      public  static void Main(string[] args)
        {
           System.DateTime currentTime=System.DateTime.Now;
           Time t=new Time(currentTime);
           
           t.Display();
  
           System.Console.WriteLine("before the hour updated");
           int temphour=t.Hour;
        
           temphour++;
        
           t.Hour=temphour;
           System.Console.WriteLine("after the hour updated ");
           
           t.Display();
        }
    }
}            
我这个程序用vc studio.net的时候可以实现预先估计的结果  但我用在dos的环境下 运行的时候 屏幕显示当前的时间(计算机又下角的时间) 
然后叫我输入新的时间 当我输入一个数字后 我的电脑右下角时间中的 时,分,秒 中的 时 就变成了 我输入的那个数字了  是什么原因啊  难道是编译环境变了 结果就变了么???



 
											





 
	    

 
	