选手输入要猜的数字,其他的有电脑产生随机数进行模拟。把所有的数字进行统计生成随机数的同时进行数字的统计。下面程序只是实现了模拟电脑猜数字的过程,和从猜的数字中找出只是被猜一次的数字。Vector number = new Vector();//存储数字猜的
Vector count = new Vector();//对应的数字的猜的次数。
int guess;//电脑猜的
for( int i = 0 ; i < 10000 ; i++)//假设有一万人
{   guess = new Random().nextInt();
   int index = number.indexOf(String.valueOf(guess));
   if(index == -1)
    {
      number.addElement(String.valueOf(guess));
      count.addElement("1");
    }
   else
    {
      int cnt = int.parseInt(count.elementAt(index).toString());
      cnt = cnt + 1;
      count.setElementAt(String.valueOf(cnt),index);
    }
}
 Vector result = new Vector();
  for(int i = 0 ; i < number.size() ; i++) //统计只被猜到一次的数字
  {
     if(count.elementAt(i).toString() == "1")
       result.addElement(number.elementAt(i));
  } 
  然后从result中找出最小的四个。看你猜的再不在里面。