import java.util.*; //导入random类
import java.util.Scanner;
class DianMing
{
String [] name = {"张三","李四","王五","马六"};
public static void main(String[]args)
{
Scanner sc = new Scanner(System.in);
System.out.println("请输入1或0"+"1继续点名0结束点名");
int n = sc.nextInt();
while (true)
{
if (n == 1)
{
Random r = new Random();
int f = f.nextInt(name.length);
System.out.println(name[f]);
}
else
{
break;
}
}
}
}
出现了这个错误 应该还有别的地方错了 求大神指点指点
|