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

Problem 3199 Uncle Jack

Posted by fforoudian at 2010-12-24 22:05:47
Hello, I am using the following code for Problem 3199 and it is not working.  Can you please let me know what I am doing wrong.


#include <iostream>
using namespace std;

int main()
{
     int n,d, i, j;
     long int V[10][26];

	for (j=1; j <= 10; j++)
	{
	 	for (i=0; i <= 25; i++) 
		  {
			  V[j-1][i]=1;
			  if (i!=0) 
				  V[j-1][i] =V[j-1][i-1] * j;
			  else 
				  V[j-1][i]=j;
		  }

	}
	while(scanf("%d %d",&n,&d)!=EOF)
    {
		if (n==0 && d==0) goto end;
		else printf("%d\n",V[n-1][d-1]);
	}
end:
	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