冒泡排序
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); sort(a,b,c); } //冒泡排序 static void sort(int a,int b,int c) { int t; if (a>b) { t=a; a=b; b=t; if (b>c) { t=b; b=c; c=t; } }else if(b>c) { t=b; b=c; c=t; } if (a>b) { t=a; a=b; b=t; } System.out.println(a+" "+b+" "+c); } }
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题8.3 (Java代码)浏览:1374 |
时间转换 (Java代码)浏览:576 |
C语言训练-素数问题 (C语言代码)浏览:1662 |
C语言程序设计教程(第三版)课后习题9.3 (Java代码)浏览:966 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:609 |
数组输出 (C语言代码)错误???浏览:567 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:605 |
简单的a+b (C语言代码)浏览:607 |
【矩阵】 (C++代码)浏览:950 |
1009题解浏览:752 |