1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
struct plaques
{
int valeur;
bool tire;
}
plaq[27];
int i;
int P1;
int P2;
int P3;
int P4;
int P5;
int P6;
int tab[28] = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 25, 25, 50, 50, 75, 75, 100, 100};
void init()
{
for (i = 0; i < 27; i++)
{
plaq[i].valeur = tab[i];
plaq[i].tire = false;
}
}
void main()
{
srand (time (NULL));
P1 = rand() % 27;
plaq[P1].valeur = tab[P1];
plaq[P1].tire = true;
cout<<plaq[P1].valeur<<endl;
P2 = rand() % 27;
plaq[P2].valeur = tab[P2];
plaq[P2].tire = true;
cout<<plaq[P2].valeur<<endl;
P3 = rand() % 27;
plaq[P3].valeur = tab[P3];
plaq[P3].tire = true;
cout<<plaq[P3].valeur<<endl;
P4 = rand() % 27;
plaq[P4].valeur = tab[P4];
plaq[P4].tire = true;
cout<<plaq[P4].valeur<<endl;
P5 = rand() % 27;
plaq[P5].valeur = tab[P5];
plaq[P5].tire = true;
cout<<plaq[P5].valeur<<endl;
P6 = rand() % 27;
plaq[P6].valeur = tab[P6];
plaq[P6].tire = true;
cout<<plaq[P6].valeur<<endl;
system("pause");
} |