Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

C++标程------------------0MS

Posted by lz1 at 2010-10-06 19:05:54 on Problem 3146
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator