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

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

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

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

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

قوة السمعة: 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 << "}";

  اقتباس المشاركة
إضافة رد


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع
انواع عرض الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع


الساعة الآن 10:54 PM.