解题思路:
注意事项:
参考代码:
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分
0 人评分
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:533 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:459 |
程序员的表白 (C语言代码)浏览:1000 |
数组输出 (C语言代码)--此题的题目描述有问题浏览:1345 |
输出正反三角形 (C语言代码)浏览:646 |
字符串的输入输出处理 (C语言代码)浏览:552 |
A+B for Input-Output Practice (V) (C语言代码)浏览:519 |
【C语言训练】求函数值 (C语言代码)浏览:489 |
WU-格式化数据输出 (C++代码)浏览:888 |
WU-拆分位数 (C++代码)浏览:685 |