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

  • 大小: 0.01M
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-09-12
  • 語言: 其他
  • 標簽: 其他??

資源簡介

LEMS.zip

資源截圖

代碼片段和文件信息

/*
?*Copyright?(c)?2018?cubestdio
?*All?rights?reserved
?*
?*filename:LSMS.cpp
?*Description:
?*
?*version:1.0
?*Author:xyc
?*Created?on?20180908
?*/
/*---------------引入頭文件---------------*/
#include?
#include?
#include?
#include?
#include?
?/*---------------聲明設備結構體類型---------------*/
typedef?struct?device
{ /*數據域*/
/*設備編號*/
char?ID[20];
/*設備類型*/
char?type[20];
/*設備型號*/
char?version[20];
/*購買日期*/
char?date[10];
/*購入價格*/
double?price;
/*管理員*/
char?admin[20];
/*設備狀態*/
char?state[20];
????/*指針域*/
????????struct?device?*next;
}??Device;
/*---------------符號常量---------------*/
#define?N?10
/*---------------函數原型---------------*/
void?welcome();
Device?*read(Device?*head);
Device?*create(FILE?*fpDevice?*m);
void?menu(Device?*head);
Device?*Add(Device?*head);
Device?*getRearPointer(Device?*head);
Device?*AddValue(Device?*headDevice?m);
void?Display(Device?*head);
int?Query(Device?*headint?a[]);
void?print_head();
void?print_row(Device?*p);
void?print_foot();
int?QueryByID(Device?*headint?a[N]char??keyword[20]);
void?CountPos(int?a[]int?index[]int?n);
Device?*Delete(Device?*head);
Device?*DeleteByPos(Device?*headint?Pos);
void?Modify(Device?*head);
void?ModifyByPos(Device?*headint?Pos);
void?Stat(Device?*head);
void?getTotalValue(Device?*head);
void?getTotalNumber(Device?*head);
double?getValueByPos(Device?*headint?Pos);
void?getFieldValue(Device?*head);
void?getFieldNumber(Device?*head);
void?Save(Device?*head);
void?destroy(Device?*head);
void?Exit(Device?*head);

/*---------------主函數---------------*/
int?main()
{ /*定義一個表頭指針變量,并將它初始化為NULL*/
Device?*head=NULL;
/*調用歡迎模塊*/
welcome();
/*調用讀取模塊*/
head=read(head);
/*調用菜單模塊*/
menu(head);
return?0;
}

/*---------------歡迎模塊---------------*/
/*
*函數名:welcome
*函數功能:輸出歡迎字符串
*函數參數:無
*函數返回值:無
*/
void?welcome()
{
printf(“##############################################################################\n“);
printf(“##?????????Welcome?to?the?laboratory?equipment?management?system!!!?????????##\n“);
printf(“##############################################################################\n“);
????printf(“請按任意鍵繼續...“);
????/*getch函數接受一個任意鍵的輸入,不用按回車就返回*/
getch();
/*下面這條語句用于清除“請按任意鍵繼續...”這幾個字*/
printf(“\r?????????????????????????????\r“);
}

/*---------------讀取模塊---------------*/
/*
*函數名:read
*函數功能:打開文本文件,若文件為空,則詢問是否添加數據,若文件非空,則進行讀取操作
*函數參數:接收表頭指針變量里存的地址
*函數返回值:返回表頭指針變量里存的地址
*/
Device?*read(Device?*head)
{
/*定義一個FILE類型的指針變量*/
FILE?*fp;
/*定義一個靜態結構體變量,因為后面需要用到它的地址*/
static?Device?m;
/*定義一個臨時變量用于詢問是否添加數據*/
char?judge;
/*文件打開及檢驗*/
if(?(fp?=?fopen(“source.txt““r“)?)?==?NULL)
{
printf(“cannot?open?sourefile!“);
exit(0);
}
/*先讀取一行數據,返回值k是指已輸入的數據個數,這樣做是為了解決只有一行記錄時出現的BUG*/
int?k=fscanf(fp“%s%s%s%s%lf%s%s\n“m.IDm.typem.versionm.date&(m.price)m.adminm.state);
/*判斷文件是否為空*/
if(k==EOF)
{ /*如果為空,則詢問是否

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????31419??2018-09-08?21:06??LEMS.cpp
?????文件?????????357??2018-03-03?21:18??source.txt

評論

共有 條評論