当前位置: 首页>>代码示例>>C++>>正文


C++ team::deduct方法代码示例

本文整理汇总了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();

}
开发者ID:vignesh2496,项目名称:CPP-Project,代码行数:40,代码来源:simulate.cpp

示例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();
   
}
开发者ID:vignesh2496,项目名称:CPP-Project,代码行数:101,代码来源:simulate.cpp


注:本文中的team::deduct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。