import java.util.Random;
public class Practice7 {
public static void main(String[] args) {
Random rand = new Random();
int coin = rand.nextInt();
if(coin % 2 == 0)
System.out.println("heads");
else System.out.println("tails");
}
}
编写一个程序 模拟扔硬币的结果
最新推荐文章于 2023-09-12 22:14:23 发布