| ||||||||||
| 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 | |||||||||
Problem 3199 Uncle JackHello, 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator