请各位看下,谢谢。
#include<iostream.h>#include<stdio.h>
int rolldice(void);
void main()
{
int gamestatus,sum,mypoint;
unsigned seed;
printf("please enter an unsigned integer:");
printf("seed");
strand(seed);
sum=rolldice();
switch(sum)
{
case7:
case11:gamestatus=1;break;
case2:
case3:
case12: gamestatus=2;break;
default:
gamestatus=0;
mypoint=sum;
cout<<"point is"<<my point<<endl;
break;
while(gamestatus==0)
{
sum=rolldice();
if(sum==mypoint)
gamepoint=1;
else
if(sum==7)
gamestatus=2;
}
if(gamestatus==1)
cout<<"player voins\n";
else
cout<<"player loses\n";
}
int rolldice(void)
{
int die1,die2,worksum;
die1=1+rand()%6;
die2=1+rand()%6;
worksum=die1+die2;
cout<<"player rolled"<<die1<<'+'<<die2<<'='<<worksum<<endl;
return worksum;
}
}
错在了哪里