public static void main(String[] args) {for (int j = 0; j < 10; j++) {
int num=1000;
int count=0;
while (true) {Random r=new Random();
int i=r.nextInt(12)+3;
if (i%3==0) {
i=2*i;
// System.out.println("暴击"+i);
}
num=num-i;
count++;
if (num<=0) {
break;
}
}
System.out.println(count+"次打死boss");
}}
|
|