本文整理汇总了C++中team::retname方法的典型用法代码示例。如果您正苦于以下问题:C++ team::retname方法的具体用法?C++ team::retname怎么用?C++ team::retname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team
的用法示例。
在下文中一共展示了team::retname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sim
void sim(team &T1,team &T2)
{
system("cls");
fstream f("team.dat",ios::in);
player p1;
int l,sum=0;
for(int i=0;i<5;i++)
{
f.read((char *)&p1,sizeof(player));
sum+=p1.rate;
}
f.close();
int res;
if((sum>380)&&(sum<410))
res=1;
else if((sum>410)&&(sum<430))
res=2;
else if((sum>430)&&(sum<450))
res=3;
else if((sum>450)&&(sum<470))
res=4;
else if((sum>470)&&(sum<500))
res=5;
int a,b,p = 0,q = 0,i,j = 9000;
float k =0;
srand(time(NULL));
gotoxy(58,6);
cout<<"___________________\n";
gotoxy(58,12);
cout<<"___________________\n";
gotoxy(58,7);
cout<<"|";
gotoxy(58,8);
cout<<"|";
gotoxy(58,9);
cout<<"|";
gotoxy(58,10);
cout<<"|";
gotoxy(58,11);
cout<<"|";
gotoxy(58,12);
cout<<"|";
gotoxy(76,7);
cout<<"|";
gotoxy(76,8);
cout<<"|";
gotoxy(76,9);
cout<<"|";
gotoxy(76,10);
cout<<"|";
gotoxy(76,11);
cout<<"|";
gotoxy(76,12);
cout<<"|";
gotoxy(60,8);
cout<<T1.retname();
gotoxy(70,8);
cout<<T2.retname();
while(j--)
{
k = k + 0.01;
gotoxy(63,4);
cout<<"TIME : "<<(int)k;
}
a = rand()%3+res;//d
b = rand()%5;
gotoxy(60,10);
cout<<" "<<a;
gotoxy(70,10);
cout<<" "<<b;
gotoxy(10,8);
if (a>b)
{
win();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\nCONGRATULATIONS!!!! ";
cout<<T1.retname()<<" won\nYou have won 5000";
T1.add();
T1.points+=3;
T1.w++;
T2.l++;
}
else if(a==b)
{
draw();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\nDraw match";
T1.points+=1;
//.........这里部分代码省略.........
示例2: sim2
void sim2(team &T1,team &T2)
{
system("cls");
fstream f("team.dat",ios::in);
player p1;
int l,sum=0;
for(int i=0;i<5;i++)
{
f.read((char *)&p1,sizeof(player));
sum+=p1.rate;
}
f.close();
int res;
if((sum>380)&&(sum<410))
res=1;
else if((sum>410)&&(sum<430))
res=2;
else if((sum>430)&&(sum<450))
res=3;
else if((sum>450)&&(sum<470))
res=4;
else if((sum>470)&&(sum<500))
res=5;
int a,b,p = 0,q = 0,i,j = 9000;
float k =0;
srand(time(NULL));
gotoxy(58,6);
cout<<"___________________\n";
gotoxy(58,12);
cout<<"___________________\n";
gotoxy(58,7);
cout<<"|";
gotoxy(58,8);
cout<<"|";
gotoxy(58,9);
cout<<"|";
gotoxy(58,10);
cout<<"|";
gotoxy(58,11);
cout<<"|";
gotoxy(58,12);
cout<<"|";
gotoxy(76,7);
cout<<"|";
gotoxy(76,8);
cout<<"|";
gotoxy(76,9);
cout<<"|";
gotoxy(76,10);
cout<<"|";
gotoxy(76,11);
cout<<"|";
gotoxy(76,12);
cout<<"|";
gotoxy(60,8);
cout<<T1.retname();
gotoxy(70,8);
cout<<T2.retname();
while(j--)
{
k = k + 0.01;
gotoxy(63,4);
cout<<"TIME : "<<(int)k;
}
a = rand()%3+res;
b = rand()%5;
gotoxy(60,10);
cout<<" "<<a;
gotoxy(70,10);
cout<<" "<<b;
gotoxy(10,8);
if (a>b)
{
char ch;
T1.add();
T1.points+=3;
T1.w++;
T2.l++;
cout<<"\n\n\n\nBrilliant!!!!:D You are the new champions League Winner.";
final();