• Write a program that outputs 6 random number in the range of 1-45
• Hint: % operator
• Allow duplicate numbers
例子)
You can win the first prize at lotto !! 19 27 23 15 34 40
c语言 一个小程序 求大神
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- tonigthdream 2015-10-04 12:41关注
static void Main(string[] args)
{
Random objRandom = new Random();
string nums = null;
for (int i = 0; i < 6; i++)
{
nums += objRandom.Next(1, 45) + " ";
}
Console.WriteLine(nums);
Console.ReadKey();
}解决 无用评论 打赏 举报
悬赏问题
- ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
- ¥15 cmd cl 0x000007b
- ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
- ¥500 火焰左右视图、视差(基于双目相机)
- ¥100 set_link_state
- ¥15 虚幻5 UE美术毛发渲染
- ¥15 CVRP 图论 物流运输优化
- ¥15 Tableau online 嵌入ppt失败
- ¥100 支付宝网页转账系统不识别账号
- ¥15 基于单片机的靶位控制系统