万能百科  > 所属分类  > 

阅读以下说明和Java代码,将应填入(n)处的字句写在对应栏内。[说明] 编写一个字符界面的Java Appli

阅读以下说明和Java代码,将应填入(n)处的字句写在对应栏内。

[说明]

编写一个字符界面的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;(1)String args [] (2) Catch(3) BufferedReadsr (4) Integer. parseInt(5) min=temp;

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签