⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 joseson.cpp

📁 it is a usefull thing
💻 CPP
字号:
//=====================================
// joseson.cpp
//=====================================
#include"boyring.h"
#include"joseson.h"
#include<iostream>
using namespace std;
//-------------------------------------
JoseSon::JoseSon(int boys, int interval, int begin, int wins)
  :Jose(boys, interval, begin),w(wins){
  if(w<1 || w>=n){
    cout<<"failed in bad winNum.\n";
    throw exception();
  }
}//------------------------------------
void JoseSon::getWinner()const{
  cout<<"There are "<<n<<" boys.\nBoys leaved in order:\n";
  BoyRing x(n);
  x.countBy(s-1);
  for(int i=1,numinLine=0; i<n-w+1; ++i){
    x.countBy(m);
    cout<<"  "<<x.getNum()<<(++numinLine%10 ? "" : "\n");
    x.disengage();
  }
  cout<<"\nWinners are\n";
  x.printAll();
}//------------------------------------

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -