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 |
C++标程------------------0MS#include <stdio.h> int t,p,n,ans,k=0; int main(void){ while (scanf ("%d%d",&p,&n)!=EOF&&n){ ans=1; while (n>0)ans=(ans*(n%p+1))%10000,n/=p; printf ("Case %d: %04d\n",++k,ans); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator