![]() |
|
![]() |
![]() |
|
~//.. يوميات عضو/هـ :: تجرد ذوآتهم بصمت .. كل ما يحدث من مواقف.. وطرائف.. وتجارب.. وما يجول بخواطرهم :: |
![]() |
#11 |
![]() ![]() ![]() |
![]()
على فكره انتي آخر شي حاطه سؤالين
يعني 13 و 14 مو 13 سؤال بس ![]() هيا ركزي شوي سؤال 13 اللي هو input an array of 100 numbers ;find the number of times a number x has occurred in the array . حله كذا #include <iostream.h> #include <stdio.h> int main() { int a[100] ; int i ,j , d , x, count=0 ; // this section for input## cout<<" Enter 100 numbers \n"; for(i=0;i<100;i++){ cin>>a[i]; } // this section for find occured## cout<<"\n Enter number to find occured\n"; cin>>x; for(d=0;d<100;d++){ if(x==a[d]){ count++; } } cout<<" occured "<<x<<" is = "<<count; g***har(); return 0; } وحل سؤال 14 الي هو input 100 numbers in an array; put all odd number in a new array and even number in another new array. وحله كذا #include <iostream.h> #include <stdio.h> int main() { int a[100] , odd[100] ,even[100] ; int i ,j , d , w=0 , f , g=0 ; // this section for input## cout<<" Enter 100 numbers \n"; for(i=0;i<100;i++){ cin>>a[i]; } // this section for sort array## for(w=0,i=0,j=0;j<100;j++){ if(a[j]%2==0){ even[w]=a[j]; w++;} else { odd[g]=a[j]; g++;} } // this section for come out even numbers## cout<<"\n the even numbers is \n"; for(i=0;i<w;i++){ cout<<endl<<even[i]; } // this section for come out odd numbers## cout<<"\n the odd numbers is \n"; for(f=0;f<g;f++){ cout<<endl<<odd[f]; } g***har(); return 0; } وآنا آسف لو حصل مني تقصير او وبجد اعتذر عن عدم حلي للسؤال العشر لكني ونا خوك ما ودي احله لك بالغلط .. حليته طلع عندي 7 اخطاء ولا اعرف وش هي ولا حبيت احله لك خطأ . ولو احتجتي اي شي انا موجود وحياك الله . |
![]() |
مواقع النشر (المفضلة) |
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
|
![]() |
||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
ا مبراطور الشوق" رهين الشوق"يعانق ألفيته العاشره | عاشقة الدموع | oO التهاني والتبريكات | 8 | 2009-12-11 06:26 PM |
تعبير رهين الشوق | الشوق | همسات أهل الشوق | 4 | 2009-10-01 09:12 PM |