
java
Loisy-M
这个作者很懒,什么都没留下…
展开
-
浅读shell排序
shell排序的关键点:每一趟以不同增量k进行跳跃排序,(我通常以k = k / 2来改变k值),并且是从距离远的元素先进行比较。public class shell02 {public static void main(String[] args) { int[] a = {333,122,456,86,17,788,14}; System.out.println("原数...原创 2018-04-13 20:25:50 · 170 阅读 · 0 评论 -
输出空心三角形
import java.util.*;class triangle { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("please input an integer:"); int row = sc.nextInt(); f...原创 2018-08-03 11:05:18 · 2572 阅读 · 0 评论 -
输出空心菱形
import java.util.*;class diamond { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("please enter an integer: "); int row = sc.nextInt();//打印上...原创 2018-08-03 15:14:56 · 636 阅读 · 0 评论 -
对两个整数变量的值进行互换(不需要第三方变量)
package com.mao.homework;public class Test06 { public static void main(String[] args) { //法一,加减法 int a1 = 12; int b1 = 34; a1 = a1 + b1; b1 = a1 - b1; a1 = a1 - b1; System.out.printl...原创 2019-05-23 15:28:03 · 476 阅读 · 0 评论 -
冒泡排序
冒泡排序:想象成鱼原创 2019-05-23 20:34:02 · 158 阅读 · 0 评论 -
Java自动装箱与自动拆箱(包装类)
一、基本介绍包装类的作用: Java 语言中,一切都是对象,但是有例外: 8 个基本数据类型不是对象,因此在很多时候非常不方便。 为此, Java提供为 8 个基本类型提供了对应的包装类: byte ------- Byte short ------ Short ...转载 2019-06-15 10:18:39 · 12782 阅读 · 3 评论