标题:新手编程,求解,我运行不出结果,大家可帮我看看是不是哪里出错了?
取消只看楼主
t120653918
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2014-7-18
结帖率:100%
 问题点数:0 回复次数:0 
新手编程,求解,我运行不出结果,大家可帮我看看是不是哪里出错了?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Student std1 = new Student();
            std1.stdno = "2013080452";
            std1.stdName = "张三";
            std1.stdSex = "男";
            std1.stdBir = new DataTime(1992, 1, 12);

            int age = std1.getAge();
            Console.WriteLine(age);

            Student std2 = new Student();
            std2.stdbir = new DataTime(1989, 5, 12);

            int age2 = std2.getAge();
            Console.WriteLine(age2);
        }
    }
}

class Student
{
    public string stdno;
    public string stdName;
    public string stdSex;
    public string stdBir;

    int getAge();
    {
        DaTatime nowTime=DaTatime.Now;
    return nowTime.Year-stdBir.Year;
    }
}
2014-07-18 11:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-434174-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.004429 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved