Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dices by GOOSE
#include <iostream> #include <ctime> using namespace std; int main() { srand(time(NULL)); int dice1_P = 1 + rand() % 6; int dice2_P = 1 + rand() % 6; cout << dice1_P << " и " << dice2_P << " выпало у игрока." << endl; int dice1_AI = 1 + rand() % 6; int dice2_AI = 1 + rand() % 6; cout << dice1_AI << " и " << dice2_AI << " выпало у ИИ." << endl; int P_Sum = dice1_P + dice2_P; int AI_Sum = dice1_AI + dice2_AI; if (P_Sum > AI_Sum) { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "Игрок победил!" << endl; } else if (P_Sum < AI_Sum) { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "ИИ победил!" << endl; } else { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "Ничья!" << endl; } return 0; }
run
|
edit
|
history
|
help
0
Copy initialization: overload resolution issue
Visual Studio 2015 Compiler Bug: 64bit multiplication
post_decrement_example
#33
C++ Assignment..
PTaHHHa
dynamic_cast in assert Causing Error
hangman
MSVC C++ runtime bug in dynamic_cast
Increment pointer to struct