1樓:
package 積跬步至千里;
public class a
count++;
if(temp%2==0)
else
}system.out.println("偶數:"+oushu+"個.");
system.out.println("奇數:"+jishu+"個.");
system.out.println("偶數出現的概率是:"+(200/oushu*50)+"%");
system.out.println("奇數出現的概率是:"+(200/jishu*50)+"%");}}
2樓:喵喵採個花
隨機數用 random 類
200個 用迴圈
套一個輸出迴圈
輸出用 system。out。print
因為 不是奇數就是偶數 所以統計一個就行
int count=0
if(隨機數 %2==0)
輸出count 就是偶數的個數 200-count 就是奇數的
編寫程式,隨機生成50個兩位整數,按每行10個輸出 5
3樓:兄弟連教育北京總校
看代來碼:自12
3456
78910
1112
1314
1516
1718
1920
2122
2324
2526
2728
2930
3132
#include
#include
void print_arr (int* a, int n)}printf("\n");
}#define n 50
int main(int argc, char** argv)print_arr(a, n);
return 0;}
4樓:匿名使用者
#include
#include
void main()}
5樓:匿名使用者
給採納,給你=寫~ - -
用JAVA編寫宣告基類Shape,在此基礎上派生出Re
public class test abstract class shapeclass rectangle extends shapepublic double getarea class circle extends shapepublic double getarea 測試結果長3寬5的長方形面...
如何使用vi編寫Java的HelloWorld程式並編譯
陳mc樂園 vi 只是編輯器,儲存退出後,可以命令列看到當前儲存的檔案。比如ls hello.c 接下來要用編譯器來編譯程式,比如gcc hello.c o hello 執行程式只要在命令列執行就可以了,比如.hello建議先去了解一下基本的shell命令。如下 vi tmp.c 按i進入插入模式,...
編寫java程式,定義學生類student,屬性包含
public class student public student string name,string age,string gender public string getname public void setname string name public string getage pu...