/**********************/
/* soubor while-1.c */
/**********************/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
const POCET = 10;
int main(void)
{
static int celkem, pocet;
printf("\nHazim kostkou dokud mi nepadne %d-krat sestka. ...\n", POCET);
srand((unsigned) time(NULL) );
while (pocet < POCET)
{
celkem++;
if ((rand() % 6 + 1) == 6)
pocet++;
}
printf("\nA je to! Hodu bylo celkem %d.\n\n", celkem);
return 0;
}