#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{ int r,a,b,c,d;
//int x,y;
double x,y,z;
int aa=1,bb=1,cc=1,dd=1;
long int num=500000,zhuang=500000,wan=5000000;
srand(time(NULL));
for(d=0;d<num;d++)
{
r=rand()%6+1;
a=rand()%6+1;
b=rand()%6+1;
c=rand()%6+1;
if(r==a && r==b && r==c)
{
wan=wan+6;
zhuang=zhuang-6;
continue;
}
if(r==a && r==b || r==a && r==c || r==b && r==c)
{
wan=wan+2;
zhuang=zhuang-2;
continue;
}
if(r==a || r==b || r==c)
{
wan=wan+1;
zhuang=zhuang-1;
continue;
}
if(r*a==b*c || r*b==a*c || r*c==a*b)
{
wan=wan+0;
zhuang=zhuang-0;
continue;
}
wan=wan-1;
zhuang=zhuang+1;
}
x=zhuang-500000;
y=500000.0;
z=x/y;
printf("%.3lf\n",z);
}
#include <stdlib.h>
#include <time.h>
int main()
{ int r,a,b,c,d;
//int x,y;
double x,y,z;
int aa=1,bb=1,cc=1,dd=1;
long int num=500000,zhuang=500000,wan=5000000;
srand(time(NULL));
for(d=0;d<num;d++)
{
r=rand()%6+1;
a=rand()%6+1;
b=rand()%6+1;
c=rand()%6+1;
if(r==a && r==b && r==c)
{
wan=wan+6;
zhuang=zhuang-6;
continue;
}
if(r==a && r==b || r==a && r==c || r==b && r==c)
{
wan=wan+2;
zhuang=zhuang-2;
continue;
}
if(r==a || r==b || r==c)
{
wan=wan+1;
zhuang=zhuang-1;
continue;
}
if(r*a==b*c || r*b==a*c || r*c==a*b)
{
wan=wan+0;
zhuang=zhuang-0;
continue;
}
wan=wan-1;
zhuang=zhuang+1;
}
x=zhuang-500000;
y=500000.0;
z=x/y;
printf("%.3lf\n",z);
}