السلام عليكم
قمت بتنفيذ برنامج round robin
يوجد خطأين بهذه الدالــة
والدالة ليست خاطئة كما اعلم
clrscr();
كذلك مكتبة الروند روبن
#include "roundrobin.h"
ما هو الخطأ فيها ؟؟
ارجو الرد سريعا حتى يتم تنفيذ البرنامج
تحياتي
السلام عليكم
قمت بتنفيذ برنامج round robin
يوجد خطأين بهذه الدالــة
والدالة ليست خاطئة كما اعلم
clrscr();
كذلك مكتبة الروند روبن
#include "roundrobin.h"
ما هو الخطأ فيها ؟؟
ارجو الرد سريعا حتى يتم تنفيذ البرنامج
تحياتي
ما بعرف والله
انا بشتغل على ؤ بلس بلس 6
؟؟
طيب اخي ما هو الحل ؟؟
و كيف ممكن ان استبدلها ؟
هاد برنامج تاني انا عملته
ماف ياخطاء
ارجوك طبقه حتى تعرف لماذا يعلق البرنامج عند رقم 3
وتحاول تعدله
#include <iostream>
using namespace std;
class nod
{public:
int data;
nod *next;
nod *prev;
nod(int x)
{
next= NULL;
prev= NULL;
data=x;
}
};
class queu{
public:
nod *h;
int x;
queu()
{h=NULL;}
bool empty()
{
if (h->next == h->prev)
return 1;
else
return 0;
}
void enqueu (int num)
{
nod *temp;
temp = new nod(x);
temp ->data = num;
if (h == NULL){
h =temp;
h ->next =h;
h->prev =h;}
else{
h->prev->next=h;
temp->prev=h->prev;
h->prev=temp;
temp->next=h;}
}
int Dequeue()
{ int temp;
temp= h->data;
if( h== h->prev )
{
delete h;
h=NULL;}
else {
nod *h2;
h2=h->next;
h->next->prev=h->prev;
h->prev->next=h->next;
h->next=NULL;
h->prev=NULL;
delete h;
h=h2;
}return temp;
}
void print()
{
nod *p=h;
while (p!=NULL)
{
cout<<p->data;
p=p->next;}
}
};
void main()
{
int x;
queu obj;
int choice,time_slice ,cpu_time;
cin>>x;
cout<<"1.enter 1 to insert cpu time\n 2.enter 2 to insert the time slice . \n 3- enter 3 to perform RR algorethem ";
cin>>choice;
while (choice>0){
switch (choice)
{
case 1:
cin>>cpu_time;break;
case 2:
cin>>time_slice;break;
case 3:
while(!obj.empty())
{
x= obj.Dequeue();
x=x - time_slice;
if(x>0)
obj.enqueu(x);
obj.print();
}
break;
default :
cout<<"try again";
}
cin>>choice;
}
}الله يسامحكم تابعوا الموضوع
............
؟؟؟
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…