C语言程序设计物流管理系统
#include
#include
#include
typedef struct _goods
{
char NO[6];//编号
char name[10];//送货员姓名
char mudidi[10];//目的地
char qianshouren[15];//签收人姓名
int call;//号码
}Goods;
void insert(Goods goods[50],Goods x);
void print(Goods goods[50],int temp);
void printall(Goods goods[50],int i);
int find(Goods goods[50],char NO[6]);
void del(Goods goods[50],char NO[6]);
void sortNO(Goods goods[50]);
void sortlea(Goods goods[50]);
void change(Goods goods[50]);
void changep(Goods goods[50]);
void changet(Goods goods[50]);
int num=5;//初始数
void insert(Goods goods[50],Goods x)//插入一条记录
{
goods[num]=x;
num++;
}
void print(Goods goods[50],int temp)//输出一个模块
{
printf("%s\t%s\t%s\t%s\t%d\n",goods[temp].NO,goods[temp].name,
goods[temp].mudidi,goods[temp].qianshouren,goods[temp].call);
}
void printall(Goods goods[50],int i)//输出所有
{
int k;
{
printf("\t编号\t名称\t目的地\t签收人\t号码\n");
for(k=0;k
{
printf("\t%s\t%s\t%s\t%s\t%d\n ",goods[k].NO,goods[k].name,
goods[k].mudidi,goods[k].qianshouren,goods[k].call);
}
}
}
int find(Goods goods[50],char NO[6])//查找
{
int i;
for(i=0;i
{
if(strcmp(goods[i].NO,NO)==0)
return i;
}
return -1;
}
void del(Goods goods[50],char NO[6])//删除
{
int i;
int temp=find(goods,NO);
if(temp==-1)
printf("不存在!\n");
else
{
for(i=temp+1;i
{
goods[i-1]=goods[i];
}
num--;
}
}
void sortlea(Goods goods[50])//号码排序函数
{
int i,j;
Goods temp;
for(i=num-1;i>0;i--)
{
for(j=0;j
{
if(goods[j].call>goods[j+1].call)
{
temp=goods[j];
goods[j]=goods[j+1];
goods[j+1]=temp;
}
else
continue;
}
}
printall(goods,1);
}
void sortNO(Goods goods[50])//订单排序
{
int i,j;
Goods temp;
for(i=num-1;i>0;i--)
{
for(j=0;j
{
if(strcmp(goods[j].NO,goods[j+1].NO)>0)
{
temp=goods[j];
goods[j]=goods[j+1];
goods[j+1]=temp;
}
else
continue;
}
}
printall(goods,1);
}
void change(Goods goods[50])//修改函数(号码)
{
int i,j;
printf("请输入要