[说明]
编写一个字符界面的Java Application 程序,接受用户输入的10个整数,并输出这10个整数的最大值和最小值。
[Java 代码]
import java. io.* ;
public class abc
public static void main ( (1) )
int i, n=10, max=0, min=0, temp=0;
try
BufferedReader br = new BufferedReader (
new InputStreamReader ( System.in ) );
max = min =Integer. parselnt ( br. readLine ( ) );
. (2) ( IOExccption e ) ;
for ( i=2 ; i<=n ; i++ )
try
BufferedReader br = new (3) (
new InputStreamReader ( System. in ) );
temp = (4) ( br. readLine ( ));
if (temp>max ) max=temp;
if (temp<min) (5)
catch (IOException e ) ;
System.out.println ( "max="+max+"\nmin="+min );
参考答案:(1)String args [] (2) Catch
(3) BufferedReadsr (4) Integer. parseInt
(5) min=temp;