第七章编程题
2018-01-06 10:18
162 查看
7.
/*Input.java*/ package test; import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class Input { public static void main(String[] args) { int i=0; int[] j=new int[10]; Scanner input=new Scanner(System.in); while(i<10) { int s; try {System.out.println("输入数据:"); s=input.nextInt(); if(s>1){ j[i]=s; i++; } else throw(new IOException()); } catch (IOException e) { System.out.println("输入错误!"); continue; } } System.out.println(Arrays.toString(j)); Arrays.sort(j); System.out.println("max:"+j[j.length-1]); System.out.println("min:"+j[0]); } }
8.throws TimedOutException
相关文章推荐
- c++ primer plus 第七章《编程题7.13.9》
- c++ primer plus 第七章《编程题7.13.1-求两个数的调和平均数》
- c++ primer plus 第七章《编程题7.13.7》
- C++ Primer Plus 第六版(中文版)课后编程题----第七章
- c++ primer plus 第七章《编程题7.13.8a》
- c++ primer plus 第七章《编程题7.13.8b》
- C和指针第七章编程题
- c++ primer plus 第七章《编程题7.13.10》
- C++ Primer第七章课后编程题
- c++ primer plus 第七章-编程题7.13.5《求任意一个数的阶乘》
- 初刷leetcode编程题总结
- 网易游戏技术岗在线编程题(一)
- 网易2016研发工程师编程题:扫描透镜
- [编程题]数对
- C#高级编程 (第六版) 学习 第七章:委托和事件
- 第七章 JDBC
- 2016百度编程题:罪犯转移
- 第七章练习题2
- 2637: 编程题:类---矩形类
- C++ Primer 笔记——第七章 类