| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
求救!为什么我这个当K=1时就不对呢?void main(){
int k,r,m;
scanf("%d",&k);
while(k!=0&&k<14){
for(m=k+1; ;m++)
{
int personno=k*2;
int curposition=0;
for(r=1; ;r++)
{
int killno=(m-1+curposition)%personno;
personno--;
curposition=killno%personno;
if(killno<k)break;
}
if(r>k)
{
printf("%d\n",m);break;
}
}
scanf("%d",&k);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator