新手编程,求解,我运行不出结果,大家可帮我看看是不是哪里出错了?
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;
}
}