switch (qwe111) {
case 1:
color = "red";
break;
case 2:
color = "green";
break;
case 3:
color = "blue";
break;
case 4:
color = "yellow";
}
#include <iostream>
#include <random>
#include <iomanip>
using namespace std;
class Random {
public:
Random() {
random_device device;
gen.seed(device());
}
int uniform(int first, int last) {
uniform_int_distribution<int> uid(first, last);
return uid(gen);
}
int poisson(double lambda) {
poisson_distribution<int> pd(lambda);
return pd(gen);
}
private:
mt19937 gen;
};
int main() {
Random rand;
int n = 25;
do {
auto a = rand.uniform(1, 4);
cout << setw(3) << a << '\n';
} while (--n);
}
#include <string>
using namespace std;
class Uno
{
private:
int intager;
string color;
int start = 1;
int end = 4;
int qwe111 = 0;
public:
Uno()
{
intager = 0;
}
int randomik()
{
srand(time(0));
qwe111 = rand() % (end - start + 1) + start;
switch (qwe111)
{
case 1:
color = "red";
case 2:
color = "green";
case 3:
color = "blue";
case 4:
color = "yellow";
}
return 0;
}
void orint()
{
cout << color;
}
int getIntager()
{
return intager;
}
string GetColor()
{
return color;
}
};
bool operator==(Uno& opedata, Uno& ope)
{
return opedata.GetColor() == ope.GetColor() & ope.getIntager() == opedata.getIntager();
}
int main()
{
srand(time(0));
Uno a;
Uno b;
a.randomik();
a.orint();
b.randomik();
b.orint();
return a.GetColor() == b.GetColor();
}