解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void Sort(int a,int b,int c){
int temp;
if(a>b){
temp = b;
b = a;
a = temp;
}
if(a>c){
temp = a;
a = c;
c = temp;
}
if(b>c){
temp = b;
b = c;
c = temp;
}
System.out.print(a+" "+b+" "+c+" ");
}
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Sort(a, b, c);
}
}
0.0分
1 人评分
浏览:592 |
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:388 |
C二级辅导-同因查找 (C语言代码)浏览:645 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:1023 |
蛇行矩阵 (C语言代码)浏览:728 |
【计算直线的交点数】 (C语言代码)浏览:1394 |
C语言训练-数字母 (C语言代码)浏览:580 |
数组与指针的问题浏览:705 |
钟神赛车 (C语言代码)浏览:572 |
时间转换 (C语言代码)浏览:616 |