Advertisement
ItsWolfiy

Générateur de nombres (v. 2)

Jan 7th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int main(){
  4.     char encore;
  5.     system("mode 60, 22");
  6. //Titre
  7.     printf("%c=====================================%c\n", 201, 187);
  8.     printf("%c G%cn%crateur de nombres (10 affich%cs) %c\n", 186, 130, 130, 130, 186);
  9.     printf("%c=====================================%c\n\n", 200, 188);
  10. //Nombre aléatoire
  11.     int x=0;
  12.     //Changement de série
  13.     srand(time(NULL));
  14.     //Nombre
  15.     while (x<10){
  16.     printf ("%d\n", rand()%101);
  17.     x++;
  18.     }
  19.  
  20.     //Relancement (oui)
  21.     printf("\n\n\n[Y] Pour une nouvelle g%cn%cration\n[N] Pour quitter\n\n", 130, 130);
  22.     scanf("%s", &encore);
  23.  
  24.     if(encore == 'Y'){
  25.         main();
  26.         }
  27.     else if(encore == 'y'){
  28.         main();
  29.         }
  30.     //Quitter (Non)
  31.     else if(encore == 'N')
  32.         exit(0);
  33.     else if(encore == 'n')
  34.         exit(0);
  35.  
  36.         //Autres
  37.     if(encore == 'q');
  38.             printf("\nLa prochaine fois, choisissez entre Y (oui) ou N (non) :)\nAppuyez sur [ENTER] pour quitter.\n");
  39.  
  40. getch();
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement