public class exercise_720_13 {
public static void main(String[] args) {
for (int i = 0; i < 6; i++) {
int random = (int) (Math.random() * 50 + 1);
System.out.println(“随机数:” + random);
huatu(random);
}
}
public static long huatu(int random) {
for (int i = 0; i < random; i++) {
System.out.print("*");
}
System.out.println();
return random;
}
}
题目:读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*,绘制该图。
最新推荐文章于 2023-03-28 10:51:46 发布