package com.lrq;
import org.omg.Messaging.SyncScopeHelper;
/**
*
* @author 李瑞琦 随机生成[1-10000]的数100个,并找出最大的数
*
*/
public class TestArray1 {
public static void main(String[] args) {
int length =
100;
int[] a =
new int[length];
for (
int i =
0; i < a.length; i++) {
a[i] = (
int) (Math.random() *
10000 +
1);
}
int max = a[
0];
for (
int i =
1; i < a.length; i++) {
if (a[i] > max) {
max = a[i];
}
}
System.out.println(
"最大的数为" + max);
}
}