zoukankan      html  css  js  c++  java
  • 第二次作业

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace ConsoleApplication1
    {
    public class Time
    {
    int Year = 1995; int Month = 3; int Date = 11; int Hour; int Minute; int Second;
    public void DisplayCurrentTime()
    {
    Console.WriteLine("{0},{1},{2},{3},{4},{5}", Year, Month, Date, Hour, Minute, Second);
    }

    public Time(int Year, int Month, int Date, int Hour, int Minute, int Second)
    {
    this.Year = Year;
    this.Month = Month;
    this.Date = Date;
    this.Hour = Hour;
    this.Minute = Minute;
    this.Second = Second;
    }
    public Time(Time Timecopy)
    {
    Year = Timecopy.Year;
    Month = Timecopy.Month;
    Date = Timecopy.Date;
    Hour = Timecopy.Hour;
    Minute = Timecopy.Minute;
    Second = Timecopy.Second;
    }
    }
    public class Tester
    {
    static void Main()
    {
    Time t = new Time(1995,3,11,3,3,3);
    t.DisplayCurrentTime();
    Console.ReadLine();
    Time t2 = new Time(t);
    t2.DisplayCurrentTime();
    Console.ReadLine();
    }
    }
    }

  • 相关阅读:
    为什么要财务自由
    2019小目标
    《小狗钱钱》后感
    从月光入门到迈出投资第一步
    tslint编译问题-内存溢出
    简单数组
    计算矩阵的乘积
    非数组求杨辉三角
    一维数组求杨辉三角
    二维数组求杨辉三角
  • 原文地址:https://www.cnblogs.com/zeromaiko/p/4361231.html
Copyright © 2011-2022 走看看