【发布时间】:2013-01-31 22:11:21
【问题描述】:
我需要帮助编写一个代码,让用户在不重复相同数字的情况下输入 50 到 150 之间的 10 个数字。这将是一个循环程序。到目前为止,这是我所拥有的:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace IP3_Program
{
class Program
{
static void Main()
{
int total = 0;
string inValue;
int [] number = new int[10];
for (int i = 0; i < number.Length; i++)
{
Console.Write("Enter number{0}: ", i + 1);
inValue = Console.ReadLine();
number[i] = Convert.ToInt32(inValue);
}
}
}
}
【问题讨论】:
-
目前看起来还不错。您需要什么帮助?
-
你想看if
-
您需要有一个特定的问题,以便我们可以帮助您,而不仅仅是要求完美运行的代码。
标签: c# loops if-statement random input