>>831
問2(flip()のみ)

int flip(void)
{
srand(time(NULL));
if (((rand()+1.0)/(RAND_MAX+1.0)) > 0.5)
return 1;
else
return 0;
}