本文整理汇总了C++中team::deduct方法的典型用法代码示例。如果您正苦于以下问题:C++ team::deduct方法的具体用法?C++ team::deduct怎么用?C++ team::deduct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team
的用法示例。
在下文中一共展示了team::deduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sim1
void sim1(team &T1,team &T2)
{
system("cls");
int a,b,p = 0,q = 0,i,j = 9000;
float k =0;
srand(time(NULL));
a = rand()%5;
b = rand()%5;
if (a>b)
{
T1.add();
T1.points+=3;
T1.w++;
T2.l++;
}
else if(a==b)
{
T1.points+=1;
T2.points+=1;
T1.rem+=2000;
T2.rem+=2000;
T1.d++;
T2.d++;
}
else
{
T2.points+=3;
T2.add();
T2.w++;
T1.l++;
}
T1.deduct();
}
示例2: sim
//.........这里部分代码省略.........
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;
T2.points+=1;
T1.rem+=2000;
T2.rem+=2000;
T1.d++;
T2.d++;
cout<<"\nYou win 2000";
}
else
{
lose();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\nHARD LUCK ";
cout<<T1.retname()<<" lost";
T2.points+=3;
T2.add();
T2.w++;
T1.l++;
}
T1.deduct();
}