0
此方法需要一個int - 但我不斷收到一條錯誤消息,有誰知道爲什麼?線程「主」java.lang.ArithmeticException中的異常:/由零發現因子
//finds the factors of a number that was entered
public void findFactors(int t)
{
System.out.println("factors of " +t+ " are:");
for(int i =0; i<t+1; i++)
{
if(t%i == 0)
{
System.out.println(i);
}
}
}