51,409
社区成员
发帖
与我相关
我的任务
分享
import java.io.*;
public class abc
{
public static void main (String args[])
{
int i,n=10,max=0,min=0,temp=0;
try {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
max=Integer.parseInt(br.readLine());
min = max;
}
catch (IOException e){};
for(i=2;i<=n;i++){
try {BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
temp=Integer.parseInt(br.readLine());
if(temp>max)
max=temp;
if(temp<min)
min=temp;}
catch (IOException e){}
}
System.out.println("max="+max+"\nmin="+min);
}
}