摘要: /** * The method for sorting the numbers */ public class SelectionSortAndInsertionort { public static void main(String[] args) { double[] list = {1,2,3,4,5,0}; selectionSort(l... 阅读全文
posted @ 2017-03-25 10:36 Gsk.Space 阅读(142) 评论(0) 推荐(0)
摘要: public class GetChar { //按大小顺序存放1000以内的素数 List list = new ArrayList(); //输出差值为2的双素数 public void getTwinPrimes(int n){ int m = getListOfPrime(n).size(); for(int i ... 阅读全文
posted @ 2017-03-20 20:44 Gsk.Space 阅读(509) 评论(0) 推荐(0)
摘要: //随机生成a到z 的字母 public class GetChar { public static void main(String[] args) { char a = (char) ('a' + Math.random() * ('z' - 'a' + 1)); System.out.println(a); } } 阅读全文
posted @ 2017-03-18 10:09 Gsk.Space 阅读(212) 评论(0) 推荐(0)
摘要: /** * 假设这个圆的半径是1。那么圆的面积就是π而外接正方形的面积是4. * 随便产生正方形中的一个点。 * 该点落在这个圆内的概率是 * 圆面积/正方形面积 = π/4 * */ public class GetValueπ { public static void main(String[] args) { final int Number_... 阅读全文
posted @ 2017-03-17 13:50 Gsk.Space 阅读(1085) 评论(0) 推荐(0)
摘要: public class WelcomeInMessageDialogBox { public static void main(String[] args) { //提问的个数 final int NUMBER_OF_QUESRIONS = 5; //正确的个数 int correctCount 阅读全文
posted @ 2017-03-17 13:09 Gsk.Space 阅读(109) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { String set1 = "1 3 5 7\n" + "9 11 13 15\n" + "17 19 21 23\n" + "25 27 29 31"; String set2 = "2 3 6 7\n" + "10 阅读全文
posted @ 2017-03-16 19:26 Gsk.Space 阅读(344) 评论(0) 推荐(0)