欢迎来到天天文库
浏览记录
ID:55687085
大小:12.50 KB
页数:2页
时间:2020-05-24
《先进先出页面置换算法.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、#include#defineM20//要访问的页面数#defineN3//内存容量voidFIFO(inta[N],intb[M]){inti,j,k;intc[M]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};floats;for(i=0;i2、);}printf("");printf("");}k=N;for(j=N;j3、");}s=k*1.0/M;printf("中断次数为:%d",k);printf("缺页率为:%f",s);}voidmain(){inti;inta[N]={0,0,0};intb[M];printf("FIFO页面置换算法");printf("");printf("输入要访问的页面:");for(i=0;i
2、);}printf("");printf("");}k=N;for(j=N;j3、");}s=k*1.0/M;printf("中断次数为:%d",k);printf("缺页率为:%f",s);}voidmain(){inti;inta[N]={0,0,0};intb[M];printf("FIFO页面置换算法");printf("");printf("输入要访问的页面:");for(i=0;i
3、");}s=k*1.0/M;printf("中断次数为:%d",k);printf("缺页率为:%f",s);}voidmain(){inti;inta[N]={0,0,0};intb[M];printf("FIFO页面置换算法");printf("");printf("输入要访问的页面:");for(i=0;i
此文档下载收益归作者所有