[問(wèn)答題] 下列Application程序輸入一個(gè)整數(shù),求出它的所有因子,請(qǐng)根據(jù)注釋,將程序補(bǔ)充完整。 public class test19_2 p
2021-07-20
[問(wèn)答題] 下列Application程序輸入一個(gè)整數(shù),求出它的所有因子,請(qǐng)根據(jù)注釋,將程序補(bǔ)充完整。
public class test19_2
public static void main(String args[])throws IOException
int n;
//下面7行語(yǔ)句的作用是從鍵盤輸入n的值
InputStreamReader ir;
BufferedReader in;
ir=new lnputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("Input n is:");
String s=in.______;//讀取1行字符
n=Integer.parseInt(s);
//下面求n的所有因子
______(int i=1;i
if(n%i!=0)
______;//跳過(guò)打印語(yǔ)句回到循環(huán)起始
System.out.print(i+””);
System.out.print(“”);
正確答案:readLine( ) for continue
詞條內(nèi)容僅供參考,如果您需要解決具體問(wèn)題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。