このコードでダメ??

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
int coin[10]; // コイン 表…1 裏…0
int omote, ura, i, sum;
double f;
omote = ura = 0; // 最後の一枚が表か裏か
srand((unsigned)time(NULL)); // 乱数初期化
for(;;) {
do { sum = 0;
for(i=0;i<10;i++) { coin[i] = rand()%2;sum += coin[i];}
} while(sum < 9); // 少なくとも9枚が表になるまでコインを投げる
if(sum==9) ura++; else omote++;
f=(double)omote/(omote+ura);
printf("表= %d枚 , 裏= %d枚 , 表の確率=%f \n",omote,ura,f);
}
return 0;
}