C#程序输出姓名的一项过不了

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:25:18
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
abstract class Person
{protected int a,c,d;
protected string b;
public Person(int m,string n,int x, int y)

{a=m;b=n;x=c;y=d;}
public abstract void Display();
}
class Teacher:Person
{
public Teacher(int m, string n, int x, int y) : base(m, n, x, y) { }
public override void Display()
{
Console.WriteLine("The ID of teacher is {0}", a);
Console.WriteLine("The name of teacher is {0}", b);
Console.WriteLine("The salary of teacher is {0}", c);
Console.WriteLine("The office of teacher if {0}", d);

}
}
class Student:Person
{
publ

Teacher t = new Teacher(1, "Tom", 3000, 8);
Student s = new Student(5, "Petty", 5, 98);

自己看,明白不
string 要加""

除了2L说的我还要问一下,你这里是什么意思:
public Person(int m,string n,int x, int y)

{a=m;b=n;x=c;y=d;}

x=c;???

二楼正解.
才华H 工作团队代做毕业设计.可hi我...

Display(); 这个哪里去啦??