class A2
{
public static void main(String []args)
{
int a[]={12,15,28,34,10};
int i;
int max=0;
int min=0;
for(i=0;i<5;i++)
{
if (max<=a[i])
max=a[i];
if(min>=a[i])
min=a[i];
}
System.out.println(max);
System.out.println(min);
}
}
{
public static void main(String []args)
{
int a[]={12,15,28,34,10};
int i;
int max=0;
int min=0;
for(i=0;i<5;i++)
{
if (max<=a[i])
max=a[i];
if(min>=a[i])
min=a[i];
}
System.out.println(max);
System.out.println(min);
}
}
樹欲靜而風不止... http://blog./seablue_xj