roll.cpp
来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C++ 代码 · 共 25 行
CPP
25 行
#include <iostream>using namespace std;#include "dice.h"// simple program illustrating use of Dice class// roll two dice, print results, Owen Astrachan, 3/31/99int main(){ Dice cube(6); // six-sided die Dice dodeca(12); // twelve-sided die cout << "rolling " << cube.NumSides() << " sided die" << endl; cout << cube.Roll() << endl; cout << cube.Roll() << endl; cout << "rolled " << cube.NumRolls() << " times" << endl; cout << "rolling " << dodeca.NumSides() << " sided die" << endl; cout << dodeca.Roll() << endl; cout << dodeca.Roll() << endl; cout << dodeca.Roll() << endl; cout << "rolled " << dodeca.NumRolls() << " times" << endl; return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?