如何在m个给定的数字中选出n个数字(m值不定,n值固定)?,谢谢 谢谢啦那还要先判断M等于几,然后再把这些数字放在数组里?然后取aray[根据随机数产生的值]。还有问一下,JSP有没可变长的数组? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to: jinsfree(三天就结贴) ,能不能给个具体的例子或你的思想?谢谢了,我是菜鸟 import java.util.*;public class testRandom{ static int X=50; static int n=5; //Main method public static void main(String[] args) { try { ArrayList arColl=new ArrayList(); for(int i=0;i<X;i++) { arColl.add(i+""); } for(int i=0;i<n;i++) { System.out.println(i+":"+(int)(Math.random()*arColl.size()));; } } catch(Exception e) { e.printStackTrace(); } new testRandom(); }} 我刚接触手机网站,wml参数怎么样传到jsp里面 js表单为什么没有验证? 关于EXT tree的加载选中状态 如何根据返回值设置select标签的选中项 100分求动态生成html的问题! Servlet里面怎么使用自己写的Bean oracle中读取clob字段,大家帮忙! 一个初学者的困惑!!! 一个数据库库的问题(放分100) 我给分从不吝啬! 【急!急!急】如何用JSP或JAVA程序实现将Excel表格中的内容导入到SqlServer2000中 html 的referrer是什么?
{
static int X=50;
static int n=5; //Main method
public static void main(String[] args)
{
try
{
ArrayList arColl=new ArrayList();
for(int i=0;i<X;i++)
{
arColl.add(i+"");
} for(int i=0;i<n;i++)
{
System.out.println(i+":"+(int)(Math.random()*arColl.size()));;
}
}
catch(Exception e) {
e.printStackTrace();
}
new testRandom();
}
}