C语言物流管理系统

C语言物流管理系统,第1张

物流管理系统

1、基础信息管理

增加员工

删除员工

显示员工

2、配送管理

配送查询

3、仓储管理

货品入库

货品出库

货品查询

货品盘点

4、退出程序

链接: https://pan.baidu.com/s/1GmGR4JRyRsjnnrZTTM1Bxw?pwd=1111

提取码: 1111

struct goods{

int number

char *desc

float weight,length,width,height

float price

}

struct depot{

goods store[10]

int storeNum

int total

void intidepot()

{

storeNum=0

total=10

}

void ingoods(goods &gd)

{

store[storeNum]=gd

storeNum++

}

float caculateprice()

{

float totalWeight=0.0

for(int i=0i<storeNumi++)

totalWeight+=store[i].price

return totalWeight

}

}

不是很明白的你的价格还有物流是怎么回事

设该快递公司有N个同规格的存货柜(编号为1 -- N),柜子共有ROW层(从上到下编号为1 -- ROW),每层有COLMN个格子(从左往右编号为1 -- COLNM)。假定手机尾号为7168的客户的快件存放在第二个柜子的第五层、第三个格子中,则输入信息为2 5 3 7168,若该格子中有物品,则显示提示息,并要求管理员重新输入数据,直到存放成功为止。取物品时,只需输入7168即可,如找到了则显示存放位置(柜子编号、层编号和格子编号),否则提示管理员未找到该客户的快件。

#include <stdio.h>

#include <conio.h>  // for _getch()

#include <stdlib.h> // for system()

#include <memory.h> // for memset()

const int N = 13

const int ROW = 10

const int COLMN = 10

const int MAXSIZE = 15

int deposit(int a[][ROW][COLMN],int cabinet,int row,int colmn,int client) {

if(cabinet < 1 || cabinet > N) {

printf("对不起,没有编号为:%d的柜子。\n",cabinet)

return 0

}

if(row < 1 || row > ROW) {

printf("对不起,%d柜没有%d层。\n",cabinet,row)

return 0

}

if(colmn < 1 || colmn > COLMN) {

printf("对不起,%d柜%d层没有%格。\n",cabinet,row,colmn)

return 0

}

a[cabinet - 1][row - 1][colmn - 1] = client

return 1

}

int draw(int a[][ROW][COLMN],int client) {

int i,j,k

for(i = 0 i < N ++i) {

for(j = 0 j < ROW ++j) {

for(k = 0 k < COLMN ++k) {

if(a[i][j][k]) {

printf("存放位置:%d柜 第%d层 第%d格\n",i + 1, j + 1, k + 1)

a[i][j][k] = 0

return 1

}

}

}

}

printf("对不起,没有找到手机尾号为%d客户的快件。\n")

return 0

}

int main() {

int cabinet,row,colmn,client

int op

FILE *fp

char filename[] = "storeroom.bin"

int storeroom[N][ROW][COLMN]

if((fp = fopen(filename,"rb")) == NULL) {

memset(storeroom,0,sizeof(storeroom))

fp = fopen(filename,"wb")

}

else {

fread(storeroom,sizeof(storeroom),1,fp)

fclose(fp)

fp = fopen(filename,"wb")

}

do {

printf("┌─────────────────┐\n")

printf("│          快递管理程序            │\n")

printf("├─────────────────┤\n")

printf("│          1、快件存放             │\n")

printf("│          2、快件领取             │\n")

printf("├─────────────────┤\n")

printf("│          0、退出                 │\n")

printf("└─────────────────┘\n")

printf("请选择:")

op = _getch()

if(op < '0' || op > '2') {

system("cls")

continue

}

printf("%c\n",op)

fflush(stdin)

switch(op - '0') {

case 1 : printf("柜 层 格 尾号:")

scanf("%d%d%d%d",&cabinet,&row,&colmn,&client)

deposit(storeroom,cabinet,row,colmn,client)

break

case 2 : printf("手机尾号:")scanf("%d",&client)

draw(storeroom,client)

break

case 0 : break

default : printf("错误的选择。\n") break

}

}while(op - '0')

fwrite(storeroom,sizeof(storeroom),1,fp)

fclose(fp)

return 0

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12141312.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存