This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*1. 接收使用者輸入的數,直到使用者輸入 -1 為止,並將使用者過去輸入的數,全部一起於一列印出,並用空白分開。 | |
- Scanner, nextInt | |
- ArrayList - 使用者輸入的數字存在這 | |
- 透過 for 印出*/ | |
public class PrintKeyin{ | |
public static void main(String args[]){ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
3.請寫一個 Method, 接收最大亂數值、最小亂數值產生一個落在範圍裡的亂數,並印出 | |
public void printRandom(int max, int min){ | |
} | |
*/ | |
public class MaxMin{ | |
public void printRandom(int max, int min){ | |
double min = Math.min(); |