Skip to content

Instantly share code, notes, and snippets.

@BalicantaYao
Last active March 4, 2018 01:17
Show Gist options
  • Save BalicantaYao/d9916961c9d973bb39c0e27c3fddfff3 to your computer and use it in GitHub Desktop.
Save BalicantaYao/d9916961c9d973bb39c0e27c3fddfff3 to your computer and use it in GitHub Desktop.
20180225 Java Homework
1.(數列反印) 亂數產生10個介於2~2000的偶數,依序存到陣列內,再反印之,
輸出範例
原始數列: 250 1400 890 126 1844 734 182 1922 36 976
反印數列: 976 36 1922 182 734 1844 126 890 1400 250
2.(數列和) 亂數產生10個整數,值介於1-99之間,求10個整數和.
3.請寫一個 Method, 接收最大亂數值、最小亂數值產生一個落在範圍裡的亂數,並印出
public void printRandom(int max, int min){
}
進階題
4.(丟棄重複的數,duplicate elimination)資料結構新增資料時,不存重複資料的現象.
請寫程式產生20個介於1~50之間的亂數,將所有不重複的數存於陣列.
5.(最接近的數)用亂數產生10個整數,介於0~100之間,找出其中兩個最接近的數.
@claire1220
Copy link

@JasonSupper
Copy link

please help to check the code as below, I can't find the error.
https://gist.github.com/JasonSupper/609861e40adcddfd8e43a13b00395daa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment