代码拉取完成,页面将自动刷新
#include <iostream>
using namespace std;
class TestPaper {
public:
virtual string Answer1() = 0;
virtual string Answer2() = 0;
virtual string Answer3() = 0;
virtual void TestQuestion1() {
cout << "杨过得到,后来给郭靖,炼成倚大剑、屠龙刀的玄铁可能是():" << endl;
cout << "a.球磨铸铁 b.马口铁 c.高速合金钢 d.碳素纤维" << endl;
cout << "答案: " << Answer1() << endl;
}
virtual void TestQuestion2() {
cout << "杨过、程英、陆无双铲除了情花,造成():" << endl;
cout << "a.使这种植物不再害人 b.使一种珍稀物种灭绝 c.破坏了那个生物圈的生态平衡 d.造成该地区沙漠化" << endl;
cout << "答案: " << Answer2() << endl;
}
virtual void TestQuestion3() {
cout << "蓝凤凰致使华山师徒、桃吞六仙呕吐不止,如果你是大夫,会给他们开什么药():" << endl;
cout << "a.阿司匹林 b.牛黄解毒片 c.氟哌酸 d.让他们喝大量的生牛奶 e.以上全不对" << endl;
cout << "答案: " << Answer3() << endl;
}
};
//学生甲抄的试卷
class TestPaperA : public TestPaper {
public:
virtual string Answer1() {
return "b";
}
virtual string Answer2() {
return "a";
}
virtual string Answer3() {
return "c";
}
};
//学生乙抄的试卷
class TestPaperB : public TestPaper {
public:
virtual string Answer1() {
return "d";
}
virtual string Answer2() {
return "b";
}
virtual string Answer3() {
return "a";
}
};
int main(int argc, char *argv[])
{
cout << "学生甲抄的试卷: " << endl;
shared_ptr<TestPaper> studentA(new TestPaperA());
studentA->TestQuestion1();
studentA->TestQuestion2();
studentA->TestQuestion3();
cout << "学生乙抄的试卷: " << endl;
shared_ptr<TestPaper> studentB(new TestPaperB());
studentB->TestQuestion1();
studentB->TestQuestion2();
studentB->TestQuestion3();
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。