作者在 2009-07-10 06:55:02 发布以下内容
#include<stdio.h>
#include<time.h>
main()
{
int h,b,k,i;
h=0;
b=0;
for (i=0;i<500;i++)
{
k=rand()%7+1;
if(k<=3)
h++;
else
b++;
}
printf("hongqiuyou%d\n",h);
printf("baiqiuyou%d\n",b);
getch();
}
#include<time.h>
main()
{
int h,b,k,i;
h=0;
b=0;
for (i=0;i<500;i++)
{
k=rand()%7+1;
if(k<=3)
h++;
else
b++;
}
printf("hongqiuyou%d\n",h);
printf("baiqiuyou%d\n",b);
getch();
}