whatsthequizmain.cpp
来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C++ 代码 · 共 19 行
CPP
19 行
int main()
{
tvector<Question *> questions;
questions.push_back(new HardMathQuestion());
questions.push_back(new WhatsTheQuestion("what's the capital of ","statequiz.dat"));
questions.push_back(new WhatsTheQuestion("what artist made ","cdquiz.dat"));
int qCount = PromptlnRange("how many questions",1,10);
RandGen gen;
for(int k=0; k < qCount; k++)
{ int index = gen.RandInt(0,questions.size()-1);
GiveQuestion(*questions[index]);
}
for(int k=0; k < questions.size(); k++)
{ delete questions[k];
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?