JAVA 冒泡基础版
public class Sort4 { public static void main(String[] args) { int x = 9; int y = 2; int z = 1; int temp = 0; if(x > y) { temp = x; x = y; y = temp; } if(x > z) { temp = x; x = z; z = temp; } if(y > z) { temp = y; y = z; z = temp; } System.out.println(x+"=="+y+"=="+z); } }
传播知识,分享快乐!
作者:IT_BULL
出处:http://www.cnblogs.com/itBulls/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
博客园-博客园。