به این کد یه نگاه بنداز امیدوارم بتونه کمکت کنه
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace tekrar
{
class tekrar
{
static void Main(string[] args)
{
int[] x = new int[10];
int[] count = new int[10];
string[] cellnum = new string[10];
for (int i = 0; i < 10; i++)
{
count[i] = 1;
System.Console.WriteLine("enter #{0}", i+1);
x[i]= int.Parse(Console.ReadLine());
for (int j = 0; j < i; j++)
{
if (x[j] == x[i])
{
count[j] += 1;
if (count[j]==2)
cellnum[j] += (j + 1) + "," + (i + 1);
else
cellnum[j] += ","+(i + 1) ;
break;
}
}
}
for (int k = 0; k < 10; k++)
{
if (count[k]>1)
System.Console.WriteLine
("{1} bar adade {0} tekrar shode ast({2})"
, x[k], count[k], cellnum[k]);
}
System.Console.ReadLine();
}
}
}