解题思路:
注意事项:
参考代码:
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 人评分
C语言训练-求PI* (C语言代码)(正确结果竟然是谜一样的3.141591)浏览:1187 |
点我有惊喜!你懂得!浏览:952 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:484 |
简单的a+b (C语言代码)浏览:632 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:462 |
人见人爱A+B (C语言代码)浏览:562 |
拆分位数 (C语言代码)浏览:1230 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:475 |
WU-格式化数据输出 (C++代码)浏览:995 |
【金明的预算方案】 (C++代码)浏览:795 |