我这程序怎么还是没法运行
把这个程序改了 可是怎么还是没法运行
而且让电脑代替人模拟10000次并且记录change和不change的获胜次数我也不会!!!!!!!急啊
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
int select,door;
void main()
{
door=rand()%3+1;
cout <<"you can choose one door of the three" <<endl;
cin>>select;
if(select==door)
void same();
else
void different();
}
void same()
{
int select1;
switch(select1)
case 1:
cout<<"The door2 has a consolation prize.Do you want to change your select"<<endl;
case 2:
cout<<"The door1 has a consolation prize.Do you want to change your select"<<endl;
case 3:
cout<<"The door2 has a consolation prize.Do you want to change your select"<<endl;
cout<<"please select again: door1 door2 door3"<<endl;
cin>>select1;
if(select1==door)
cout<<"You win the game"<<endl;
else
cout<<"You lose"<<endl;
}
void different()
{
int select2;
switch(select2)
case select==1,door==2:
cout<<"The door3 has a consolation prize.Do you want to change your select"<<endl;
case select==2,door==1:
cout<<"The door3 has a consolation prize.Do you want to change your select"<<endl;
case select==3,door==1:
cout<<"The door2 has a consolation prize.Do you want to change your select"<<endl;
case select==1,door==3:
cout<<"The door2 has a consolation prize.Do you want to change your select"<<endl;
case select==2,door==3:
cout<<"The door1 has a consolation prize.Do you want to change your select"<<endl;
case select==3,door==2:
cout<<"The door1 has a consolation prize.Do you want to change your select"<<endl;
cout<<"please select again: door1 door2 door3"<<endl;
cin>>select2;
if(select2==door)
cout<<"You win the game"<<endl;
else
cout<<"You lose"<<endl;
}