#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX_NUM 100 //数组最大长度
typedef struct _EQUIPMENT
{
int num;//编号
int is_bolish;//是否报废
char style[20];//种类
char name[20];//名称
char buy_date[20];//购入日期
char bolish_date[20];//报废日期
float price;//价格
}EQU;
int Addnew(EQU arr[],int cur)//添加新设备
{
system("cls");
printf("输入编号:");
scanf("%d",&arr[cur].num);
printf("输入设备种类:");
scanf("%s",arr[cur].style);
printf("输入设备名称:");
scanf("%s",arr[cur].name);
printf("输入购入日期:");
scanf("%s",arr[cur].buy_date);
printf("输入购入价格:");
scanf("%f",&arr[cur].price);
printf("设备是否报废(1:报废 0:未报废):");
scanf("%d",&arr[cur].is_bolish);
if(arr[cur].is_bolish==1)//根据是否报废 判断是否要输入报废日期
{
printf("输入报废日期:");
scanf("%s",arr[cur].bolish_date);
}
printf("录入成功!\n");
system("pause");
return cur+1;//数组长度+1
}
/*
显示设备
根据首地址和数量n显
实验室设备管理系统
最新推荐文章于 2024-06-13 01:11:05 发布