回複:誰能幫我看看這道 java題??

來源: 2003-12-16 16:08:00 [舊帖] [給我悄悄話] 本文已被閱讀:

public int roll ()
{ faceValue = (int) (Math.random() * numFaces) % numFaces+ 1;
return faceValue;
}



public int[] frequency(int n)
{
int [] t = new int[numFaces+1];
for(int i=0;i t[roll()]+=1;
return t;

}



--文學城www.wenxuecity.com--