0

Make random choice

I'm trying to make that my c++ program choses randomly between 2 possible Outputs,can someone help me plese

11th Dec 2019, 12:04 AM
Daniel Vetter
Daniel Vetter - avatar
1 Answer
0
#include <random> #include <ctime> srand(time(0)); x = 1+rand()%2; // random between 1 and 2
11th Dec 2019, 1:51 AM
Š­Š»ŠµŠ¾Š½Š¾Ń€Š° Š”ŠµŃ€Š³ŠµŠµŠ²Š°
Š­Š»ŠµŠ¾Š½Š¾Ń€Š° Š”ŠµŃ€Š³ŠµŠµŠ²Š° - avatar