السلام عليكم
ده الكود
الكود صح بس اللوجيك logic خطأاقتباسConsole.WriteLine("Please Enter The Number Of Names : ");int NumN = int.Parse(Console.ReadLine());
string [] Names = new string [NumN];
for (int i = 0; i < NumN; i++)
{
Console.WriteLine("Please Enter The Name {0} : {1}",(i+1),Names);
Names = Console.ReadLine();
}
string SearchN;
Console.WriteLine("Please Enter The Name You want To Search It :");
SearchN=Console.ReadLine();
int n=0;
Console.Clear();
for (int i = 0; i < NumN; i++)
{
if (Names == SearchN)
{
Console.Clear();
Console.WriteLine("This Name Is Found");
n++;
Console.WriteLine("The Number Of The Name You Search It Is : " + n);
}
else
{
Console.WriteLine("This Name Is Not Found");
}
}
المفروض انى بدخل عدد معين من الاسماء وبعدين ابحث عن اسم معين ويقولى الاسم ده موجود كام مرة
في انتظار رد حضراتكم
في امان الله