??C++???????????
???????????? ???????[ 2014/3/26 11:25:58 ] ????????C++ ???? ???
?????????Sleep(1000)?????1000???????????????????#include<window.h>??
???????????????????1???????У??????????????
???????????????????????????????λ?????????????????main?????????????????????Ч??????????
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class shaizi
{
public:
void setdian();
int getdian();
private:
int dian;
};
const int round=9; //round?????????????
int main()
{
shaizi s1??s2;
int i=1??n1=0??n2=0;
srand(time(0)); //?????????????????????????????????????????
while(i<=round)
{
s1.setdian();
s2.setdian();
cout<<"??"<<i<<"??: ?? "<<s1.getdian()<<"????: "<<s2.getdian();
if(s1.getdian()>s2.getdian())
n1++;
else if (s2.getdian()>s1.getdian())
n2++;
else
{
cout<<"????????? "<<endl;
continue;
}
i++;
cout<<endl;
if(n1==(round/2+1)||n2==(round/2+1))
break;
}
cout << "??? "<<n1<<" ?????? "<<n2<<" ??";
if(n1>n2)
cout<<"?????"<<endl;
else if(n2>n1)
cout<<"?????"<<endl;
return 0;
}
int shaizi::getdian()
{
return dian;
}
void shaizi::setdian()
{
dian=rand()%6+1;
}
????????б????????????н?????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11