This is a question about java,I need some help!

This is a question about java,I need some help!

题目
This is a question about java,I need some help!
Write a program that asks the user for three floating point (decimal) numbers and prints the three numbers in sorted order.For example:
Please enter three numbers:
4
9
2.5
The numbers in sorted order are
2.5
4
9
wo cong lai mei zuo guo a ,bu zhi dao zm zuo a ,wo ye bu xiang da yingwen ke shi zhe dian nao mei zhong wen de shu ru fa ,qiu bang zu
答案
这问题确实不难,多看看书上的
import java.util.Arrays;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
int i = 3;
int[] list = new int[3];
System.out.println("please Please enter three numbers:");
for (int j = 0; j < i; j++) {
Scanner sc = new Scanner(System.in);
String t = sc.next();
list[j] = Integer.parseInt(t);
}
Arrays.sort(list);
System.out.println("The numbers in sorted order are:");
for (int k :list) {
System.out.println(k);
}
}
}
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.