Deprecated: Assigning the return value of new by reference is deprecated in /www/wwwroot/shabab.ps/public_html/vb/showpost.php on line 218

Deprecated: Assigning the return value of new by reference is deprecated in /www/wwwroot/shabab.ps/public_html/vb/showpost.php on line 223
منتديات شباب فلسطين - عرض مشاركة واحدة - Help me please......أخ محمـود
عرض مشاركة واحدة
قديم 06-03-2009, 12:37 AM   #6
محمود
..{ مديــــــر عــــام }..
 
الصورة الرمزية محمود
عيد فطر سعيد ,,

قوة السمعة: 50 محمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond reputeمحمود has a reputation beyond repute

افتراضي رد: Help me please......أخ محمـود

أوكي خيو موضوعك سهل ،،

مش كثير صعب ،،

رح أعطيك الفكرة بالبرمجة ،،

وانت عدل ..


هيك بكون معك 90% من البرنامج ،،

طبعا ً انا زمان ما كتبت ع c++ وبالأساس ما درستها ،، يعني رح تلاقي شوية اخطاء إملائية :D

لهيك شوف يخوي هي عندك الكود ..

حاول تفهمه ..

كود PHP:


int arraySet1
[50];
int arraySet2[50];
int n=0,m=0;


int main ()
{
//*---- First set
cout << "How Many Number woud u like enter info first set ?";
cin >> n
ReadArray 
(arraySet1,n);


//*---- Second set
cout << "How Many Number woud u like enter info Second set ?";
cin >> m
ReadArray 
(arraySet2,m);

//*-- print Array 1
PrintArray(arraySet1,n);

//*-- print Array 2

PrintArray(arraySet2,m);

//*---- InterSection Array print 

IntersectionOfIntegerSet(ArraySet1,n,ArraySet2,m);

}


void ReadArray (intArraySetint n)
{
int x=0;
for (
int j=0;j<n;j++)
{
cout << "Enter element " << << " ? ";
cin >> x
arraySet
[j]=x;
}
}



void IntersectionOfIntegerSet(const int ArraySet1,int n, const int ArraySet2int m)
{
int c=0;
if(
m>n)
{
int IntersectionOfIntegerSet[n];
for (
int i=0;i<n;i++)
{
for(
int j=0;j<m;j++)
{
if(
ArraySet1[i] == ArraySet2[j]) { IntersectionOfIntegerSet[c]= ArraySet1[i] ; c++; }
}
}
}else
{
int IntersectionOfIntegerSet[m];
for (
int i=0;i<m;i++)
{
for(
int j=0;j<n;j++)
{
if(
ArraySet2[i] == ArraySet1[j]) { IntersectionOfIntegerSet[c]= ArraySet1[i] ; c++ }
}
}
}

cout << "

 InterSection Array is "
;
PrintArray (IntersectionOfIntegerSet,sizeof(IntersectionOfIntegerSet));

}


void PrintArray (const int ArraySetTempint n)
{
cout << "{";
for(
int i=0;i<n;i++)
{
cout <<  ArraySetTemp[i] << " , ";
}
cout << "}";

  اقتباس المشاركة