91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 30KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-08-08
  • 語言: C/C++
  • 標簽: C語言??

資源簡介

完整的大學數(shù)據(jù)結構大作業(yè),雜志管理系統(tǒng)

資源截圖

代碼片段和文件信息

#include“stdio.h“
#include“string.h“
#include“stdlib.h“
typedef?struct?node?*?pointer;
typedef?struct?From_Customer{??//訂戶的訂單信息的鏈表
char?id[10];
char?name[10];
int?number;
int?amount;
int?price;
int?m;
struct?From_Customer?*next;
}Customer;

struct?node{
char?Name[10];??????????//訂戶信息鏈表
char?Password[10];
pointer?next;
Customer?id[100];
};
typedef?pointer?lklist;

typedef?struct?Information{???//管理員管理的訂單信息鏈表
char?name[10];
int?number;
int?amount;
int?price;
int?t;
struct?Information?*next;
}magazine;

void?By_NumberSort(magazine?*mag);
void?By_AmountSort(magazine?*mag);
void?By_PriceSort(magazine?*mag);
void?By_NameSort(magazine?*mag);
void?By_Filed(magazine?*mag);
void?By_numberCheck(magazine?*mag);
void?By_AmountCheck(magazine?*mag);
void?By_PriceCheck(magazine?*mag);
void?By_nameCheck(magazine?*mag);

void?Check_No(magazine?*mag);
void?Change_magzine(magazine?*mag);
void?Delete_magzine(magazine?*mag);

void?save_CustomerForm(Customer?*q);
void?open_CustomerForm(Customer?*q);

void?open_spmatrix(magazine?*mag)??????//讀取文件
{
FILE?*fp;
magazine?*p?*t;
p?=?mag;
if?((fp?=?fopen(“mag.txt“?“rb“))?==?NULL)
{
fp?=?fopen(“mag.txt“?“wb“);
}
while?(!feof(fp))
{
t?=?(magazine?*)malloc(sizeof(Information));
if?(fread(t?sizeof(Information)?1?fp)?!=?1)
{
if?(feof(fp))
{
fclose(fp);
return;
}
printf(“文件讀取錯誤!\n“);
}
else
{
p->next?=?t;
p?=?t;
}
}
}

void?save_spmatrix(magazine?*mag){???//保存文件
FILE?*fp;
magazine?*p;
p?=?mag->next;
if?((fp?=?fopen(“mag.txt“?“w“))?==?NULL){
printf(“文件有誤\n“);
}
while?(p?!=?NULL){
if?(fwrite(p?sizeof(Information)?1?fp)?!=?1){
printf(“File?write?error!\n“);
break;
}
p?=?p->next;
}
fclose(fp);
}
void?open_information(lklist?head){
FILE?*fp;
pointer?p?t;
p?=?head;
if?((fp?=?fopen(“information.txt“?“rb“))?==?NULL)
{
fp?=?fopen(“information.txt“?“wb“);
}
while?(!feof(fp))
{
t?=?(pointer)malloc(sizeof(struct?node));
if?(fread(t?sizeof(struct?node)?1?fp)?!=?1)
{
//p->m1?=?0;
if?(feof(fp))
{
fclose(fp);
return;
}
printf(“文件讀取錯誤!\n“);
}
else
{
p->next?=?t;
p?=?t;
}
}
}
?
void?Check_ByNo(magazine?*mag){????????//按字段查詢
int?m?=?1;
while?(m){
printf(“?????????--------------------\n“);
printf(“????????丨?\23?1.按編號查詢???丨\n“);
printf(“????????丨?\23?2.按單價查詢???丨\n“);
printf(“????????丨?\23?3.按名字查詢???丨\n“);
printf(“????????丨?\23?4.返回上一級???丨\n“);
printf(“?????????--------------------\n“);
printf(“請選擇要執(zhí)行的選擇:?“);
int?x;
scanf(“%d“?&x);
if?(x?==?1){
By_numberCheck(mag);
}

if?(x?==?2){
By_PriceCheck(mag);
}
if?(x?==?3){
By_nameCheck(mag);
}
if?(x?==?4){
m?=?0;
}
}
}
void?Show_All(magazine?*mag){?????//顯示庫存雜志信息,自動提示是否按字段查詢
magazine?*p;
p?=?mag->next;
int?k;
while?(p?!=?NULL){
printf(“------------

評論

共有 條評論