Random randObj = new Random();
int start=1;//随机数可取该下界值
int end=10;//随机数不能取该上界值
for( int j= start ; j < end; j++ ){
Console.Write( "{0,11} ",randObj.Next( start, end) );
}
就可以生成1-10之间的随机数了
int start=1;//随机数可取该下界值
int end=10;//随机数不能取该上界值
for( int j= start ; j < end; j++ ){
Console.Write( "{0,11} ",randObj.Next( start, end) );
}
就可以生成1-10之间的随机数了
转载于:https://www.cnblogs.com/hekeboy/archive/2009/05/05/1450012.html
最后
以上就是典雅冬瓜最近收集整理的关于生成1-10之间的随机数的全部内容,更多相关生成1-10之间内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复