求如何限制输入(数字)不能重复的C#代码!

来源:百度知道 编辑:UC知道 时间:2024/08/20 12:01:19

using System;
using System.Collections.Generic;
using System.Text;

namespace 限制相同数字
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("please input your num");
string s = Console.ReadLine();
try
{
check(s);
}
catch
{
Console.WriteLine("something wrong");
}
Console.ReadLine();
}
public static void check(string temp)
{
string all = "0123456789";
char[] a ={ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
int j;
char[] t1 = new char[1];
for (int i = 0; i < temp.Length;