/**
* 获取N位随机数
*
* @param num
* @return
*/
public static int getNbitRandomNumber(int num) {
if (num <= 0) {
throw new IllegalArgumentException();
}
double d = (Math.random() * 9 + 1) * (Math.pow(10, num - 1));
return (new Double(d)).intValue();
}