?? 00.txt
字號:
#include <string.h>
#include <iostream.h>
#include <math.h>
void main()
{
struct aa
{ int yh;
int bz;
int ymh;
int xgbz;
int cpwz;
}
m[7]={{0,1,5,0,11},
{1,1,8,0,12},
{2,1,9,0,13},
{3,1,1,0,21},
{4,0,0,0,22},
{5,0,0,0,23},
{6,0,0,0,121}};
char a[10];
int b,c,j,i,k=0,p[4]={5,8,9,1};
cout<<"修改-modi 退出-quit"<<endl;
cout<<"please input instruction:"<<endl;
cin>>a;
if(strcmp(a,"quit")==0)return;
cin>>b>>c;
while(strcmp(a,"quit")!=0)
{
for(j=0;j<7;j++)
if(m[j].yh==b)
{
if(m[j].bz==1)
{
cout<<"address:"<<m[j].ymh*1024+c<<endl;
cout<<"page address:"<<m[j].cpwz<<endl;
if(strcmp(a,"modi")==0)
m[j].xgbz=1;
}
else
{
for(i=0;i<7;i++)
if(m[i].ymh==p[k])
{
if(m[i].xgbz==1)
cout<<"第"<<m[i].yh<<"頁修改過換出前需寫入硬盤!"<<endl;
cout<<"page out:"<<m[i].yh<<endl;
m[i].bz=0;
m[i].ymh=0;
m[i].xgbz=0;
}
m[j].bz=1;
m[j].ymh=p[k];
if(strcmp(a,"modi")==0)
m[j].xgbz=1;
cout<<"page in:"<<m[j].yh<<endl;
cout<<"address:"<<m[j].ymh*1024+c<<endl;
cout<<"page address:"<<m[j].cpwz<<endl;
k=(k+1)>4;
}
}
cin>>a;
if(strcmp(a,"quit")==0)return;
cin>>b>>c;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -