我需要幫助編寫一個代碼,作爲用戶輸入50到150之間的10個數字而不重複相同的數字。這將是一個循環程序。這是我到目前爲止有:C#用戶輸入隨機數
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](http://msdn.microsoft.com/en-us/library/5011f09h(VS.80).aspx) – Default