التميز خلال 24 ساعة

 العضو الأكثر نشاطاً هذا اليوم   الموضوع النشط هذا اليوم   المشرف المميز لهذا اليوم 
قريبا نصائح اختيار شركة تصوير المنتجات
بقلم : غير مسجل
قريبا


صفحة 5 من 5 الأولىالأولى ... 2345
النتائج 49 إلى 56 من 56

الموضوع: برامج في c & ++c

  1. #49

    الصورة الرمزية yourlove
    تاريخ التسجيل
    Feb 2005
    الدولة
    مصر- أسوان
    العمر
    38
    المشاركات
    521
    معدل تقييم المستوى
    250

    Lightbulb برامج خاصة بالData Structure تكملة لما قد سبقت تحميله

    نبدأ أولا بـ برنامج Sorting Array using Quick Sort

    كود:
    #include<iostream.h>
    const int max=10;
    void swap(int arr[],int x,int y)
    {
    	int temp=arr[x];
    	arr[x]=arr[y];
    	arr[y]=temp;
    }
    int partition(int arr[],int first,int last)
    {
    	int lastele=first;
    	for(int i=first+1;i<=last;i++)
    	{
    		if(arr[first]>=arr[i])
    		{
    			++lastele;
    			swap(arr,lastele,i);
    		}
    	}
    	swap(arr,first,lastele);
    	return lastele;
    }
    void quick(int arr[],int first,int last)
    {
    	if(first>=last)return ;
    	int split=partition(arr,first,last);
    	quick(arr,first,split-1);
    	quick(arr,split+1,last);
    }
    int main()
    {
    	int arr[max];
    	cout<<"Enter The Array Before Sorting:"<<endl;
    	for(int i=0;i<max;i++)
    		cin>>arr[i];
    	quick(arr,0,max);
    	cout<<"The Array After Sorting Is:"<<endl;
    	for(int j=0;j<max;j++)
    		cout<<arr[j]<<endl;
    	return 0;
    }
    برنامج بحث في array عن طريق RECRSION_SEARCH

    كود:
    #include<iostream.h>
    int rec_search(int a[],int n,int target)
    {
    	if(n==0)
    		return -1;
    		if(target==a[n-1])
    		return n;
    		else
    			return rec_search(a,n-1,target);
    		return-1;
    }
    int main()
    {
    	int arr[100],t,nn;
    	cout<<"Enter The Length Of The Array :"<<endl;
    	cin>>nn;
    	cout<<"Enter The Array :"<<endl;
    	for(int j=0;j<nn;j++)
    		cin>>arr[j];
    	cout<<"Enter The Target :"<<endl;
    	cin>>t;
    	int b=rec_search(arr,nn,t);
    	cout<<"You Found The Element At Number "<<b<<endl;
    	return 0;
    }

    برنامج مثل السابق ولكن باستخدام RECRSION_BINARY_SEARCH

    كود:
    #include<iostream.h>
    int rec_binary_search(int a[],int n,int first,int last,int target)
    {
    	if(n==0)
    		return -1;
    	if(first>last)
    		return -1;
    	int mid=(first+last)/2;
    	if(target==a[mid])
    		return mid+1;
    	else
    		if(target>a[mid])
    			return rec_binary_search(a,n,mid+1,last,target);
    		else
    			return rec_binary_search(a,n,first,mid-1,target);
    }
    int main()
    {
    	int arr[10],t;
    	int nn=10;
    	cout<<"Enter The Array :"<<endl;
    	for(int i=0;i<nn;i++)
    		cin>>arr[i];
    	cout<<"Enter The Target :"<<endl;
    	cin>>t;
    	int b=rec_binary_search(arr,nn,0,9,t);
    	cout<<"You Found The Element AT Number "<<b<<endl;
    	return 0;
    }

    برنامج للتحويل من النظام ديسيمال الي بايناري Decimal to Binary

    كود:
    #include<iostream.h>
    #include<process.h>
    void BinPrint(int x,int n)
    {
    	if(n==0)
    		return;
    	if(n>0)
    		BinPrint(x/2,n-1);
    	cout<<x%2;
    }
    int main()
    {
    	int xx;
    	int nn;
    	cout<<"Enter The Number :"<<endl;
    	cin>>xx;
    	cout<<"Enter The Length :"<<endl;
    	cin>>nn;
    	cout<<"The Binary Code Is :"<<endl;
    	BinPrint(xx,nn);
    	cout<<endl;
    	return 0;
    }
    برنامج مثل السابق ولكن بأسلوب أسهل نوعا ما

    كود:
    #include<iostream.h>
    void Binary(int x)
    {
    	int x2;
    	while(x>0)
    	{
    		x2=x%2;
    	    Binary(x/2);
    	    cout<<x2;
    	    break;
    	}
    }
    int main()
    {
    	int x1;
    	cout<<"Enter A Decimal Number :"<<endl;
    	cin>>x1;
    	cout<<"The Binary Code Is :"<<endl;
    	Binary(x1);
    	cout<<endl;
    	return 0;
    }
    برنامج Stack

    كود:
    #include<iostream.h>
    #include<assert.h>
    typedef char El;
    class Stack
    {
    public:
    	Stack();
    	~Stack();
    	void push(El &elem);
    	El pop();
    	El Top();
    	bool isEmpty();
    private:
    	struct Node;
    	typedef Node *link;
    	struct Node
    	{
    		El data;
    		link next;
    	};
    	link top;
    };
    ///////////////////////////////////////////////////////////////////
    Stack::Stack()
    {
    	top=0;
    }
    void Stack::push(El &elem)
    {
    	link newnode=new Node;
    	assert(newnode);
    	newnode->data=elem;
    	newnode->next=top;
    	top=newnode;
    }
    El Stack::pop()
    {
    	assert(top);
    	link temp=top;
    	top=top->next;
    	El Elem=temp->data;
    	delete temp;
    	return Elem;
    }
    El Stack::Top()
    {
    	assert(top);
    	return top->data;
    }
    bool Stack::isEmpty()
    {
    	return top==0;
    }
    Stack::~Stack()
    {
    	link ptr;
    	while(top)
    	{
    		ptr=top;
    		top=top->next;
    		delete ptr;
    	}
    }
    int main()
    {
    	Stack S;
    	El ch;
    	cout<<"Enter Char Terminate With . :"<<endl;
    	cin.get(ch);
    	do
    	{
    		S.push(ch);
    		cin.get(ch);
    	}while(ch!='.');
    	cout<<"The Reverse Is :"<<endl;
    	while(!S.isEmpty())
    	{
    		cout<<S.pop();
    	}
    	cout<<endl;
    	return 0;
    }
    برنامج بحث وحذف واضافة في Array

    كود:
    #include<iostream.h>
    #include<process.h>
    void Delete(int arr[],int& n,int p)
    {
    	for(int i=p;i<n;i++)
    		arr[i]=arr[i+1];
    	n--;
    }
    void insert(int arr[],int& n,int num,int p)
    {
    	for(int i=n;i>=p;i--)
    		arr[i+1] = arr[i];
    	arr[p]=num;
    	n++;
    }
    int  Search(int arr[],int n,int num)
    {
    	for(int i=0;i<n;i++)
    		if(arr[i]==num)
    			return i;
    
    		return -1;
    }
    int FirstSmaller(int arr[],int n,int from,int& value)
    {
    	for(int i=from;i<n;i++)
    		if(arr[i]<value)
    		{
    			value = arr[i];
    			return i;
    		}
    		return -1;
    }
    int main()
    {
    	cout<<"Deletion"<<endl;
    	int a[100];
    	cout<<"Enter the array"<<endl;
    	for(int i=0;i<10;i++)
    		cin>>a[i];
    	int n=10;
    	cout<<"Enter the postion : ";
    	int p;
    	cin>>p;
    	Delete(a,n,p);
    	for(i=0;i<n;i++)
    		cout<<a[i]<<endl;
    	cout<<"Insertion"<<endl;
    	cout<<"Enter the number:";
    	int num;
    	cin>>num;
    	cout<<"Enter the postion : ";
    	cin>>p;
    	insert(a,n,num,p);
    	for(i=0;i<n;i++)
    		cout<<a[i]<<endl;
    	cout<<endl;
    	cout<<"Search"<<endl;
    	cout<<"Enter the number : ";
    	cin>>num;
    	cout<<"The number "<<num<<"is Found at "<<Search(a,n,num)<<endl;
    	cout<<"FirstSmaller"<<endl;
    	cout<<"Start from:";
    	int from;
    	cin>>from;
    	cout<<"Enter the value : ";
    	cin>>num;
    	cout<<"The number "<<num<<" Found at position "<<FirstSmaller(a,n,from,num)<<endl;
    	cout<<"Enter 1,2,3,4,5:"<<endl;
    	return 0;
    }
    وأتمني أن أكون قد وفقت والمرة القادة ان شاء الله ستكون في File Structure
    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

  2. #50

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    مشكووور اخي الكريم.....
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  3. #51

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    كود:
    //babu's first program,video has 25 images moving per second,I want to
    //add such two time instances.it's just a "big ball of mud" I have.
    #include <iostream.h>
    #include <stdlib.h>
    
    class tc
    {
    public:
      long int fr;
      long int fr_init;
      long int sec;
      long int min;
      long int hrs;
      long int rawmani;
      int fr_calc(int);
      int cal(int);
      int sec_on_fr(int);
      int sec_calc(int);
    int cal()
    {
      if(rawmani<10000);
      fr_init=rawmani%100;
      int fr_calc(fr_init);
      fr+=fr;
      int sec_on_fr(fr_init);
      sec+=sec ;
      int sec_calc(int)
      {
        if sec>=100;
        fr=sec%100;
        fr_calc(int);
        sec/=100;
        if (sec>59)
        sec%=60;
           return sec;
      }
      int sec_calc(sec);
        else
         if(rawmani>=10000)&&(rawmani<1000000);
         min=rawmani/10000;
         sec+=rawmani%10000;
        int sec_calc(sec);
         else
          if(rawmani>=1000000)&&rawmani<10000000);
          hrs=rawmani/1000000;
          min=rawmani%1000000;
          min_calc(int);
           else
            if rawmani<=100000000)&&(rawmani<24000000);
            hrs=rawmani/1000000;
            min=rawmani%1000000;
            min_calc(int);
            hrs_calc(int);
             else
              if (rawmani>24000000)
              fool()
    int Fr_calc(long int x)
      {
       long int intrm_frme;
       intrm_frme= (x /100;
        if ((intrm_frme>=.25)
        mediator = fr/25;
        fr%=100;
        return fr;
       }
    int sec_on_fr(long int x)
       {
        sec=fr_init/100;
        return sec;
       }
    
    int min_on_sec(long int x)
       {
        min=sec_init/60;
        return min;
       }
    int min_calc()
      {
       if(min>=100000)&&(min<1000000)
       sec= min%10000;
       min/=10000;
       if ((min>60)
       hrs++;
       min%=min
       return min;
      }
    int hr_on_min(long int x)
       {
        hr=min_init/60;
        return hr;
       }
    int hrs_calc()
      {
       long int mediator;
       intrm_hrs=raw_mani/100;
       if ((intrm_hrs>=.25)
       hrs=raw_mani%100;
       mediator=rawmani/25;
       day+=mediator;
       return hrs;
      }
    
    void fool()
          {
           cout<<"\n"<<"please don't be over whelmed,i always appriciate
    your creativity";
           cout<< "\n"<<"please make hours calculations more than 24 hours
    yourself";
           cout<<"\n"<<"Thanks for your co-operation";
          }
    void display()
        {
         cout<<hrs<<min<<sec<<fr;
        }
    }
    }tc01,tc02;
    void main()
    {
    cout<<"BABU's Frame Calculator For PAL";//PAL has 25 video frames per
    second
    cout << "\n"<<"please Enter First time code ";//timecode patern
    hh:mm:ss:ff
    cin >> tc01.rawmani;
    system("PAUSE");
      return 0;
    }
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  4. #52

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    كود:
    pass a value using a function
    
    #include<stdio.h>
     
     main()
     {
    #define CONST 50
    
    int 
    main (void)
    
     
     char myName;
     
    
    char myName[CONST];
    
     clrscr();
    
    OK to use with Turbo C, but not with other compilers.
    
     printf("Name: ");
     scanf("%s",&myName);
    
    scanf("%s",myName); 
    
     if ( checkNotEmpty(myName) )
     {
      printf("\nGood");
     }
     
     else
     {
       printf("\nEmpty name field");
     }
     
     getch();
     
    return 0;
    
     }
     
     int checkNotEmpty ( char name )
    
    int checkNotEmpty ( char *name )
    
     {
     
        if ( name != '' )
        if ( *name != '\0' )
    
        {
             return 1;
        }
        else
        {
             return 0;
        }
     }
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  5. #53

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    To create a box, you should use two dimensional arrays

    كود:
    #include<stdio.h>
     #include<conio.h>
     int main()
     {
        int q;
        char array[5][5];
        for(q=0; q<4; q++){
                 array[q][0]='_';
                 //printf("%c",array[q][0]);
                 }
        for(q=0; q<4; q++){
                 array[0][q]='|';
                 //printf("%c",array[0][q]);
                 }
        for(q=0; q<4; q++){
                 array[4][q]='|';
                 printf("%c",array[4][q]);
                 }
        for(q=0; q<4; q++){
                 array[q][4]='_';
                 //printf("%c",array[q][4]);
                 }
        getch();
        return 0;
     }
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  6. #54

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    function like rectangle ,line etc

    كود:
    #include<stdio.h>
    #include<conio.h>
    #include<dos.h>
    #define c '-'
    #define c1 '|'
    int main()
    {
        int q;
        textmode(C40);
        printf(" ");
        for(q=0; q<4; q++)
               printf("%c",c);
        for(q=0; q<4; q++)
               printf("\n%c    %c",c1,c1);
        printf("\n ");
        for(q=0; q<4; q++)
               printf("%c",c);
        getch();
        return 0;
    }
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  7. #55

    الصورة الرمزية وائل عبدالله
    تاريخ التسجيل
    Sep 2003
    الدولة
    usa
    العمر
    42
    المشاركات
    7,125
    معدل تقييم المستوى
    425
    اذا كانت الرسومات لا تعمل ففي عذا الكود الحل.........

    كود:
    initgraph(&driver,&mode,"c:\\Tc\\bgi");
    
    OR
    
    initgraph(&driver,&mode,"..\\bgi");
    مشرف سابق في شباب اليمن...

    تريد موقع قراني (تفصل من هنا)


    http://www.quran4u.co


    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

    ادخل على مكتبة صور راح تخدربك

    www.funize.net


  8. #56

    الصورة الرمزية yourlove
    تاريخ التسجيل
    Feb 2005
    الدولة
    مصر- أسوان
    العمر
    38
    المشاركات
    521
    معدل تقييم المستوى
    250
    برامج جامدة تشكر أخي وائل ومجهود رائع
    نقره لتكبير أو تصغير الصورة ونقرتين لعرض الصورة في صفحة مستقلة بحجمها الطبيعي

صفحة 5 من 5 الأولىالأولى ... 2345

معلومات الموضوع

الأعضاء الذين يشاهدون هذا الموضوع

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

المواضيع المتشابهه

  1. برامج اطفال تحميل برامج للاطفال كاملة Kids Only – Educational Software
    بواسطة عزيز زيزو في المنتدى ملتقى الرقميات
    مشاركات: 1
    آخر مشاركة: 03-05-2012, 11:59 PM
  2. مشاركات: 1
    آخر مشاركة: 10-07-2010, 06:29 PM
  3. مشاركات: 0
    آخر مشاركة: 29-05-2010, 12:27 PM
  4. مشاركات: 0
    آخر مشاركة: 15-02-2010, 11:56 AM
  5. برامج 2008 - أكبر مكتبة برامج من الشركات المنتجه مع التحديثات
    بواسطة وســــًٍأآأمـے في المنتدى ملتقى الرقميات
    مشاركات: 0
    آخر مشاركة: 02-08-2008, 09:52 AM

المفضلات

المفضلات

ضوابط المشاركة

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