#include #include #include #include using namespace std; int main() { setlocale(LC_ALL, ""); srand(time(0)); cout << "Hány alkalommal legyen feldobás? "; int db; int a, b, c, e; int anni = 0; cin >> db; for (int i = 0; i < db; i++) { a = rand() % 6 + 1; b = rand() % 6 + 1; c = rand() % 6 + 1; e = a + b + c; cout << "Dobás: " << a << " + " << b << " + " << c << " = "; cout << setw(2) << e; cout << "\tNyert: " << (e < 10 ? "Anni" : "Panni") << endl; anni += (e < 10 ? 1 : 0); } cout << "A játék során " << anni << " alkalommal Anni, "; cout << (db-anni) << " alkalommal Panni nyert." << endl; system("PAUSE"); return 0; }