//调整[0,x)区间上的数出现的概率
public class GetRandom{
//获得返回x^k概率的数
public static double randPowerK(int k)
{
if(k<1)
{
return 0;
}
double res=-1;
for(int i=0;i!=k;i++)
{
res=Math.max(res,Math.random());
}
return res;
}
public static void main(String[]args)
{
//System.out.println("Hello");
System.out.println(randPowerK(2));
}
}
