Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bcio.h>
- #include <conio.h>
- #include <stdio.h>
- #define TAILLE 10
- int main(void)
- {
- int tabCombiUser[TAILLE];
- int nb,trouve,val;
- int I=1,J=0,x=0;
- char Bla;
- do {
- do {
- bcdisplayln("Combien de valeurs?");
- bcget(nb);
- }
- while (nb < 0 || nb > 10);
- do {
- bcdisplayln("Entrez la valeur ",I);
- bcget(tabCombiUser[0]);
- }
- while (tabCombiUser[0] < 0 || tabCombiUser[0] > 100);
- I++;
- while (I<=nb)
- {
- do {
- printf("Entrez la valeur %i\n", I);
- bcget(val);
- fflush(stdin);
- }
- while (val < 0 || val > 100);
- trouve = 0;
- J=0;
- while (J<nb && trouve == 0)
- {
- if (tabCombiUser[J] == val )
- {
- bcdisplayln("Attention, les valeurs doivent toutes etre differentes");
- trouve =1;
- }
- J++;
- }
- if (trouve == 0)
- {
- x++;
- tabCombiUser[x]=val;
- I++;
- }
- }
- bcdisplay("Votre combinaison est ");
- for (x=0;x<nb;x++)
- {
- bcdisplay(tabCombiUser[x]);
- bcdisplay(" ");
- }
- bcdisplayln("Rejouer?");
- bcget(Bla);
- }
- while (Bla == 13);
- bcgetpause();
- return 0;
- }
Add Comment
Please, Sign In to add comment