package test01;
public class RandomNum2 {
public static void main(String[] args) {
int min = 99;
int max = 0;
int temp;
int count = 0;
for (int i = 0; i < 10; i++) {
temp = (int) (Math.random() * 100);
if (temp > 50) {
count++;
}
if (min > temp) {
min = temp;
}
if (max < temp) {
max = temp;
}
}
System.out.println("Max is:" + max);
System.out.println("Min is:" + min);
System.out.println("The count that bigger than 50 is:" + count);
}
}
public class RandomNum2 {
public static void main(String[] args) {
int min = 99;
int max = 0;
int temp;
int count = 0;
for (int i = 0; i < 10; i++) {
temp = (int) (Math.random() * 100);
if (temp > 50) {
count++;
}
if (min > temp) {
min = temp;
}
if (max < temp) {
max = temp;
}
}
System.out.println("Max is:" + max);
System.out.println("Min is:" + min);
System.out.println("The count that bigger than 50 is:" + count);
}
}