以下是我现写的
import java.util.Random;
public class Word {
public static void main(String args[]) {
int max = 0;
int min = 0;
String sum="";
for (int i = 0; i <= 100; i++) {
Random rand = new Random();
int r = rand.nextInt(99);
System.out.println(r);
if (r >= max) {
max = r;
} else if (r < min) {
min = r;
}
String s= ""+r;
if (r > 50) {
sum=sum+s+",";
}
}
System.out.println("max=" + max + "\n" + "min=" + min);
System.out.println(sum);
}
}