當前位置:首頁 » 編程語言 » java1到100奇數和

java1到100奇數和

發布時間: 2025-10-01 16:43:11

Ⅰ 如何用java輸出1到100之間的奇數呢

packagesrc;
publicclassTest{
publicTest(){
//TODOAuto-generatedconstructorstub
}
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
//輸出偶數
for(inti=1;i<=100;i++){
i++;
System.out.print(i);
System.out.print(" ");
}
//輸出奇數
for(inti=0;i<100;i++){
i++;
System.out.print(i);
System.out.print(" ");
}
}
}

熱點內容
怎麼破解wifi密碼蘋果手機 發布:2025-10-01 18:09:56 瀏覽:772
phpa標簽 發布:2025-10-01 18:05:35 瀏覽:732
訪問簽證英國 發布:2025-10-01 17:55:32 瀏覽:1002
內存的存儲速度快 發布:2025-10-01 17:51:15 瀏覽:239
怎樣將終端管理軟體放至雲伺服器 發布:2025-10-01 17:50:30 瀏覽:733
linuxadobereader 發布:2025-10-01 17:49:52 瀏覽:67
1元北京伺服器雲空間 發布:2025-10-01 17:34:11 瀏覽:482
pythonscons 發布:2025-10-01 17:22:44 瀏覽:753
壓縮包11G 發布:2025-10-01 17:14:13 瀏覽:376
大腳舉報不了腳本 發布:2025-10-01 16:55:00 瀏覽:590