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 |
一个模板题 附代码#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int m,n,p; int i,j,k,g; int s,f,l; while(scanf("%d%d%d",&m,&n,&p)!=EOF&&m!=0) { s=0; for(i=2;i<=m;i++) s=(s+n)%i; n=n%m; if(n==0) n=m; l=s+1+p-n; if(l>=1&&l<=m) printf("%d\n",l); else if(l<1) printf("%d\n",l+m); else if(l>m) printf("%d\n",l%m); } return 0; } 模板题 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator