資源簡介
保證能運行, 簡單易理解 很好的完成功能……操作系統課 需要!!??!
代碼片段和文件信息
#include???
#define?size?5
int?emptyfullinouta[size]={0}im=1;
void?produce()
{
int?j;
if(empty>0)???
{
????empty--;???
????a[in]=1;
????printf(“生產一件產品1為繼續生產,2為消費\n“);
????in=(in+1)%size;????
????scanf(“%d“&j);
???switch(j)?
???{
?????case?1:?i=j;break;
?????case?2:?i=j;break;?
?????default:?printf(“結束操作“);m=0;
???}
???full++;
}
???else?
???{
?????printf(“緩存池已滿無法執行生產操作\n“);
?????scanf(“%d“&j);
?????if(j==2)?i=j;??????
???}
}
void?consume()
{
??int?j;
??if(full>0)
{
????full--;
????a[out]=0;
????prin
- 上一篇:1.8編程基礎之多維數組(25題)
- 下一篇:圖形學方面的小作品(API)
評論
共有 條評論