1樓:沒玩過電腦
#include
#include
#include
#define null 0
typedef struct ufd
*lufd;
typedef struct mfd
*lmfd;
typedef struct uof
*luof;
lmfd headm,leadm;
lufd headu,leadu;
luof heado,leado;
int s=0;
char com[50];
void print()
for(i=0;i<55;i++) printf("=");
printf("\n\n");
printf("\t\t\t uof table\n");
for(i=0;i<75;i++) printf("=");
printf("\n");
printf(" filename attribute filelongth state read write\n");
while(m!=null)
for(i=0;i<75;i++) printf("=");
printf("\n");
}void init()
if((leado=heado=(luof)malloc(sizeof(struct uof)))==null)
strcpy(headu->filename,j);
headu->attribute='*';
headu->longth=0;
headu->address=(int)headu;
strcpy(heado->filename,j);
heado->attribute='*';
heado->longth=0;
heado->state='*';
heado->read=(int)heado;
heado->write=(int)heado;
leadu->next=null;
leado->next=null;
}void mfdinit()
g=(lmfd)malloc(sizeof(mfd));
g=headm;
strcpy(headm->name,f);
headm->go=headu;
leadm->next=null;
printf("\n");
printf("init the file maneger system.\n\n");
printf("\tmfd table\n");
for(i=0;i<28;i++) printf("=");
printf("\n");
printf(" username fileaddress\n");
while(g!=null)
for(i=0;i<28;i++) printf("=");
printf("\n\n");
print();
}void snew()
n->name[i]=t;
i++;
}leadm->next=n;
leadm=n;
n->next=null;
n->go=leadu->next;
printf("\n\tnew mfd table\n");
for(i=0;i<28;i++) printf("=");
printf("\n");
printf(" username fileaddress\n");
while(g!=null)
for(i=0;i<28;i++) printf("=");
printf("\n\n");
}void create( )
;int longth=0;
char attribute;
lmfd t;
lufd n;
luof s;
int i;
t=(lmfd)malloc(sizeof(mfd));
n=(lufd)malloc(sizeof(ufd));
s=(luof)malloc(sizeof(uof));
t=headm;
for(i=0,s+=1;s<50;s++,i++)
}for(i=0;s<50;s++,i++)
} s++;
attribute=com[s];
getchar();getchar();
printf("%s ,,%d ,,%c",filename,longth,attribute);
dot=t->next;
}while(t!=null);
strcpy(n->filename,filename);
n->longth=longth;
n->attribute=attribute;
n->address=(int)n;
leadu->next=n;
leadu=n;
n->next=null;
printf("\nq--%s ,%d ,%c,%d",n->filename,n->longth,n->attribute,n->next);
strcpy(s->filename,filename);
s->longth=longth;
s->attribute=attribute;
s->read=(int)s;
s->write=(int)s;
s->state='s';
leado->next=s;
leado=s;
s->next=null;
printf("\nset up success.\n");
print();
}void close()
;int i;
luof s,p;
p=s=(luof)malloc(sizeof(uof));
s=heado;p=heado;
for(i=0,s+=1;s<50;s++,i++)
}dowhile(s!=null);
if(s==null)
if(s->state=='s') s->state=' ';
else
}while(p->next!=s) p=p->next;
p->next=s->next;
if(s==leado) leado=p;
free(s);
print();
printf("file close success.");
}void open()
;char op;
int i;
lufd t;
luof s,n;
t=(lufd)malloc(sizeof(ufd));
s=n=(luof)malloc(sizeof(uof));
t=headu; s=heado;
for(i=0,s+=1;s<20;s++,i++)
}op=com[s];
dowhile(t!=null);
if(t==null)
doelse
}s=s->next;
}while(s!=null);
if(t->attribute==op)
else printf("operation illedge.\n");
print();
}void delet( )
}dowhile(t!=null);
if(t==null)
dowhile(s!=null);
if(s!=null)
print();
printf("the file delete succeess.\n");
}void readf()
;int rlong;
luof t;
t=(luof)malloc(sizeof(uof));
t=heado;
for(i=0,s+=1;s<50;s++,i++)
}for(i=0;s<50;s++,i++)
} dowhile(t!=null);
if(t==null)
if(t->state!='o')
t->read+=rlong;
print();
printf("read file success.\n");
}void writef()
;int num,w,i;
luof t;
t=(luof)malloc(sizeof(uof));
t=heado;
for(i=0,s+=1;s<50;s++,i++)
}for(i=0;s<50;s++,i++)
} dowhile(t!=null);
if(t==null)
if(t->state=='s') t->write+=num;
else
else
}print();
printf("write file success.\n");
}void main ()
while(b=='y')
while(leadm!=null);
if(leadm!=null)
com[i]=t;
bom[i]=t;
}printf("1----%s,2-----%s\n",com,bom);
for(i=s;i<50;i++)
bom[i]='\0';
for(i=0;i<50;i++)
printf("%c",bom[i]);
if(strcmp(bom,"create")==0)
create();
if(strcmp(bom,"open")==0)
open();
if(strcmp(bom,"delete")==0)
delet();
if(strcmp(bom,"read")==0)
readf();
if(strcmp(bom,"write")==0)
writef();
if(strcmp(bom,"close")==0)
close();
printf("\ngo on input command [y|n]:");
if((t=getchar())=='n')
j=0;
getchar();}}
else
} printf("\n");
for(i=0;i<75;i++)
printf("=");
printf("\t\t\t\t filemanege over\n");
for(i=0;i<75;i++)
printf("=");}
高分求翻譯,十萬火急
申請人注意事項 攜此至攝影師 入境 移民 跟護照 並不一致 確保提供規定檢查表裡準確 數 攝影師注意事項 必須 展示出人物的頭部和肩膀的整個概況,以人物的臉作為相片的中心以純白色背景為底 彩色或黑白 必須是同一底片,或者,裂屏或者多鏡頭相機的同時 必須 從下巴到頭的距離要在25毫米到30毫米之間最後...
高分求助!!十萬火急!!C 萬年曆求高手幫忙進行資料封裝
include include include using namespace std class calendar int calendar monthdays 12 string calendar weekday 7 string calendar monthname 12 int main v...
數學題,十萬火急,求高手解釋
解 1 x 2 sina 2xsinb 1 x 2 sinc 0 sina sinc x 2 2sinb x sina sinc 0 方程有兩個相等實根,即b 2 4ac 0 4 sinb 2 4 sina 2 sinc 2 0 sina 2 sinb 2 sinc 2 三角形abc的形狀有 直角三...