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

大牛们帮忙看一下为什么会runtime error(java)

Posted by ecjtubaowp at 2007-01-26 13:20:42 on Problem 3181
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Main
{
 public static void main(String args[])
{
  int n,k,b,i,j;
  
  BigInteger num[][]=new BigInteger[1101][101];
  for(i=1;i<=1101;i++)
  for(j=1;j<=100;j++)num[i][j]=new BigInteger("0");
  for(i=1;i<=1101;i++)
  {
   for(j=1;j<=100;j++)
   {
    if((i==j)||(j==1))num[i][j]=new BigInteger("1");
    if(i>j)
    {
     for(b=1;b<=j;b++)
     num[i][j]=num[i][j].add(num[i-j][b]);
    }
    if(i<j)num[i][j]=new BigInteger("0");
   }
  }
  Scanner sc = new Scanner(System.in);
  n=sc.nextInt();k=sc.nextInt();
  System.out.println(num[n+k][k]);
  
}
}

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