using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mobanfangfa
{
class TestPaper
{public void Testquestion1()
{ Console.WriteLine("1+1=? a、1 b、2 c、3");
Console.WriteLine("答案" + Answer1());
}
public void Testquestion2()
{
Console.WriteLine("1+3=? a、1 b、2 c、4");
Console.WriteLine("答案" + Answer2());
}
public void Testquestion3()
{
Console.WriteLine("1+2=? a、1 b、2 c、3");
Console.WriteLine("答案" + Answer3());
}
protected virtual string Answer1()
{
return "";
}
protected virtual string Answer2()
{
return "";
}
protected virtual string Answer3()
{
return "";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mobanfangfa
{
class TestPaperA : TestPaper
{
protected override string Answer1()
{
return "a";
}
protected override string Answer2()
{
return "b";
}
protected override string Answer3()
{
return "c";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mobanfangfa
{
class TestPaperB : TestPaper
{
protected override string Answer1()
{
return "b";
}
protected override string Answer2()
{
return "c";
}
protected override string Answer3()
{
return "a";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mobanfangfa
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("学生甲抄的试卷");
TestPaperA studentA= new TestPaperA();
TestPaperB studentB=new TestPaperB();
studentA.Testquestion1();
studentA.Testquestion2();
studentA.Testquestion3();
studentB.Testquestion1();
studentB.Testquestion2();
studentB.Testquestion3();
}
}
}