rendered paste body#include <iostream>#include <iomanip>#include <stdlib.h>#include <time.h>#include <string>using namespace std;int main(){ int die; string roll, tmp; srand(time(0)); while(true) { cout << "What die do you want to use (6, 20 or 100)? "; cin >> die; if (cin.fail() || (die != 6 && die != 20 && die != 100)) { cin.clear(); getline(cin, tmp); cout << "Invalid die type, please try again." << endl << endl; continue; } cout << "Type 'roll' to roll the die: "; cin >> roll; if (cin.fail() || roll != "roll") { cin.clear(); getline(cin, tmp); cout << "Invalid command, please try again." << endl << endl; continue; } cout << "You rolled: " << rand() % die + 1; cout << endl << endl; } return 0;}