Demo entry 6324487

斯蒂芬

   

Submitted by anonymous on Nov 20, 2016 at 03:43
Language: Java. Code size: 623 Bytes.

public class mooc {

public static void main(String[] args) {
         mooc max=new mooc();
         int[] a=new int [10] ;
         for(int i=0;i<10;i++){
             double nums=(Math.random() * 1000);
        	 a [i] =(int)(nums);
        	 }
         max.show(a);
    
         
}

public void show(int []acores){
	Arrays.sort(acores);
    System.out.println("输出数组元素:"+Arrays.toString(acores));
    int max=acores[0];
	for(int i=acores.length-1;i>=0;i--){
		if(acores[i]>max){
			max=acores[i];
		    continue;}
	
	}
	System.out.print("其中a[0]为:");
	System.out.print(max);
}

}
    

		

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).