帮忙看一下,谢谢
#include<iostream>using namespace std;
int main()
{
const int Tatal=7;
int ChooseNum;
int boy[Tatal];
int i,j;
for(i=0;i<Tatal;i++)
boy[i]=i+1;
cout<<"intput a number:";
cin>>ChooseNum;
cout<<"the number at the first"<<endl;
for(i=0;i<Tatal;i++)
cout<<boy[i]<<"\t";
cout<<endl;
int k=1;
int n=-1;
while(true)
{
for(j=0;j<ChooseNum;)
{
n=(n+1)%Tatal;
if(boy[n]!=0) j++;
}
if(k=Tatal)break;
boy[n]=0;
cout<<"after"<<k<<"times elimination,the boys left are:"<<endl;
for(i=0;i<Tatal;i++)
if(boy[i]!=0) cout<<boy[i]<<"\t";
cout<<endl;
k++;
}
cout<<"the winner"<<boy[n]<<endl;
return 0;
}