import java.util.Random;
public class Practice_07 {
public static void main(String[] args){
Random r = new Random();
int b;
int a;
int k;
for(int i=0;i<=100;i++){
b = r.nextInt();
a = Math.abs(b%100);
k = a%2;
System.out.println(a+" "+i);
if(k == 0){
System.out.println("正面");
}else{
System.out.println("反面");
}
}
}
}
模拟扔硬币100次
最新推荐文章于 2022-01-31 09:04:18 发布