当前位置:首页 » 编程语言 » c语言仓库管理系统开发环境
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

c语言仓库管理系统开发环境

发布时间: 2022-05-12 05:35:34

‘壹’ 跪求高手用c语言写一个简单的仓库管理系统

1,简单起见,可采用控制台程序实现;
2,程序大概可划分为:输入模块、排序模块、输出模块等;
3,输入模块:设计一种数据结构,用来存储图书名字;
可以是指针数组,可以是链表、。。。
4,排序模块:选择一种排序算法,比如冒泡,快速排序等,上网查一下。
5,输出模块打印最终的排序结果;

如果上述你都能实现,可以再扩展,索引查询模块等等。。。
大一才开始起步,自己的要多写代码。。。 再烦也别忘微笑,再急也要注意语调!

‘贰’ 编写C语言仓库管理系统

有答案的也发下我邮箱[email protected] 谢谢啦

‘叁’ 如何用C语言编一个小型的仓库管理系统,作为课程设计的 谢了哈

可以完成源代码的编制

‘肆’ c语言程序设计家电仓库管理系统 求大神帮助

#include <stdafx.h>
#include<stdio.h>
#include<string.h>
#define SIZE 2//SIZE为仓库电器种类
struct goods
{
char name[10];
char brand[10];
char style[10];
int num;
float money;
}stu[SIZE];//库存结构
struct date
{
int year;
int month;
int day;
};//日期结构
struct entrance
{
char name[10];
char brand[10];
char style[10];
int num;
float money;
struct date time;
char stuf[10];
}stu_2[SIZE];//入库结构
struct exit
{
char name[10];
char brand[10];
char style[10];
int num;
struct date time;
char stuf[10];
}stu_3[SIZE];//出库结构
void main()
{
void save_1();
void save_2();
void save_3();
void change_1();
void change_2();
void found_1();
void found_2();
int i;
printf("please input the information:\n");
for(i=0;i<SIZE;i++)
{
scanf("%s%s%s%d%d",stu[i].name,stu[i].brand,stu[i].style,&stu[i].num,&stu[i].money);
} //输入库存
save_1(); //利用函数将库存保存
FILE *fp;
fp=fopen("stu_list.txt","rb");
for(i=0;i<SIZE;i++)
{
fread(&stu[i],sizeof(struct goods),1,fp);
printf("%s %s %s %d %d",stu[i].name,stu[i].brand,stu[i].style,stu[i].num,stu[i].money);
printf("\n");
} //读出信息
fclose(fp);
printf("请输入物资入库信息:\n");//输入入库信息
for(i=0;i<SIZE;i++)
scanf("%s%s%s%d%f%d%d%d%s",stu_2[i].name,stu_2[i].brand,stu_2[i].style,&stu_2[i].num,&stu_2[i].money,&stu_2[i].time.year,&stu_2[i].time.month,&stu_2[i].time.day,stu_2[i].stuf);
save_2(); //创建入库文件
change_1();
printf("请输入出库信息\n");
scanf("%s%s%s%d%d%d%d%s",stu_3[i].name,stu_3[i].brand,stu_3[i].style,&stu_3[i].num,&stu_3[i].time.year,&stu_3[i].time.month,&stu_3[i].time.day,stu_3[i].stuf);
for(i=0;i<SIZE;i++)
{
if(stu_3[i].num>stu[i].num)
{
printf("the error number!please input again!\n");
break;
}
else
{
save_3();
change_2();
}
}
found_1();
found_2();
}
void save_1()
{
FILE *fp;
int i;
if((fp=fopen("stu_list.txt","wb"))==NULL)
{
printf("connot open the file\n");
return;
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stu[i],sizeof(struct goods),1,fp)!=1)
printf("file write error\n");
}
fclose(fp);
}
void save_2()
{
FILE *fp;
int i;
if((fp=fopen("stu_list_2.txt","wb"))==NULL)
{
printf("connot open the file\n");
return;
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stu_2[i],sizeof(struct entrance),1,fp)!=1)
printf("file write error\n");
}
fclose(fp);
}
void change_1()
{
int i;
for(i=0;i<SIZE;i++)
{
if(strcmp(stu[i].name,stu_2[i].name)==0&&strcmp(stu[i].brand,stu_2[i].brand)==0&&strcmp(stu[i].style,stu_2[i].style)==0)
{
stu[i].num=stu[i].num+stu_2[i].num;
}
}
save_1();
}
void save_3()
{
FILE *fp;
int i;
if((fp=fopen("stu_list_3.txt","wb"))==NULL)
{
printf("connot open the file\n");
return;
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stu_3[i],sizeof(struct exit),1,fp)!=1)
printf("file write error\n");
}
fclose(fp);
}
void change_2()
{
int i;
for(i=0;i<SIZE;i++)
{
if(strcmp(stu[i].name,stu_3[i].name)==0&&strcmp(stu[i].brand,stu_3[i].brand)==0&&strcmp(stu[i].style,stu_3[i].style)==0)
{
stu[i].num=stu[i].num-stu_3[i].num;
}
}
save_1();
}
void found_1()
{
FILE *fp;
int i;
int sum=0;
char name[10];
char brand[10];
printf("please input the name and brand:\n");//4.1 4.2 5.1
scanf("%s%s",name,brand);

if((fp=fopen("stu.list.txt","rb"))==NULL)
{
printf("connot open the file!\n");
return;
}
for(i=0;i<SIZE;i++)
{
if(fread(&stu[i],sizeof(struct goods),1,fp)!=1)
{
if(strcmp(name[10],stu[i].name[10])==0)
{
printf("the information of the good:\n");
printf("%s %s %s %d %d",stu[i].name,stu[i].brand,stu[i].style,stu[i].num,stu[i].money);
sum=sum+stu[i].num;
}
if(strcmp(brand[10],stu[i].brand[10])==0)
{
printf("the information of the good:\n");
printf("%s %s %s %d %d",stu[i].name,stu[i].brand,stu[i].style,stu[i].num,stu[i].money);

}
}
}
printf("the number of this %s is %d.\n",name[10],sum);
}
void found_2()
{
FILE *fp;
int i;
int j;
int sum=0;
int year_1,year_2,month_1,month_2,day_1;
char name_1[10],name_2[10],style_1[10];
if((fp=fopen("stu_list_2.txt","rb"))==NULL)
{
printf("connot open the file!\n");
return;
}
if((fp=fopen("stu_list_3.txt","rb"))==NULL)
{
printf("connot open the file!\n");
return;
}
printf("please input year_1,month_1,day_1,then find the exit and entrance:\n");
scanf("%d%d%d",&year_1,&month_1,&day_1);
printf("please input the name and style,then find the good's entrance and exit");
scanf("%s%s",name_1,style_1);
printf("please input the name of the good,then output the number or its entrance:\n");
scanf("%s",name_2);
printf("please input year_2 and month_2,then output the number of exit in this month:\n");
scanf("%d%d",&year_2,&month_2);
printf("please input the red number,then output all the informations of the goods:\n");
scanf("%d",&j);
for(i=0;i<SIZE;i++)
{
if((fread(&stu_2[i],sizeof(struct entrance),1,fp)!=1)&&(fread(&stu_3[i],sizeof(struct exit),1,fp)!=1))//读出入库和出库信息
{
if((stu_2[i].time.year==year_1)&&(stu_2[i].time.month==month_1)&&(stu_2[i].time.day==day_1))//入库信息4.3
{
printf("%s%s%s%d%f%d%d%d%s",stu_2[i].name,stu_2[i].brand,stu_2[i].style,stu_2[i].num,stu_2[i].money,stu_2[i].time.year,stu_2[i].time.month,stu_2[i].time.day,stu_2[i].stuf);
}
if((stu_3[i].time.year==year_1)&&(stu_3[i].time.month==month_1)&&(stu_3[i].time.day==day_1))//出库信息4.3
{
printf("%s%s%s%d%d%d%d%s",stu_3[i].name,stu_3[i].brand,stu_3[i].style,stu_3[i].num,stu_3[i].time.year,stu_3[i].time.month,stu_3[i].time.day,stu_3[i].stuf);
}
}
}
for(i=0;i<SIZE;i++)//4.4
{
if((fread(&stu_2[i],sizeof(struct entrance),1,fp)!=1)&&(fread(&stu_3[i],sizeof(struct exit),1,fp)!=1))//读出入库和出库信息
{
if((strcmp(stu_2[i].name,name_1))==0&&(strcmp(stu_2[i].style,style_1))==0)
{
printf("%s%s%s%d%f%d%d%d%s",stu_2[i].name,stu_2[i].brand,stu_2[i].style,stu_2[i].num,stu_2[i].money,stu_2[i].time.year,stu_2[i].time.month,stu_2[i].time.day,stu_2[i].stuf);
}
if((strcmp(stu_3[i].name,name_1))==0&&(strcmp(stu_3[i].style,style_1))==0)
{
printf("%s%s%s%d%d%d%d%s",stu_3[i].name,stu_3[i].brand,stu_3[i].style,stu_3[i].num,stu_3[i].time.year,stu_3[i].time.month,stu_3[i].time.day,stu_3[i].stuf);
}
}
}
for(i=0;i<SIZE;i++)//5.3
{
if((fread(&stu_3[i],sizeof(struct exit),1,fp)!=1))
if(stu_3[i].time.year==year_2&&stu_3[i].time.month==month_2)
{
sum=sum+stu_3[i].num;
}
}
printf("the time of exit is %d.\n",sum);
for(i=0;i<SIZE;i++)
{
if((fread(&stu[i],sizeof(struct goods),1,fp)!=1))
{
if(stu[i].num<j)
{
printf("th information of the good are:\n");
printf("%s%s%s%d%f",stu[i].name,stu[i].brand,stu[i].style,stu[i].num,stu[i].money);
}
}
}
}

‘伍’ C语言写一个仓库管理系统

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<malloc.h>#define max 32int ifempty=0;//标志,判断链表是无否为空typedef struct dnode /* 定义双向链表结构体 */ {int number; /* 货物编号 */char name[max]; /* 货物名称 */ int counter; /* 货物数量 */struct dnode *prior, *next;/* 定义两指针,分别指向其前驱和后继 */}dlnode; dlnode *create(dlnode *L);dlnode *input(dlnode *L);dlnode *output(dlnode *L);dlnode * outnum(dlnode *L);dlnode * outname(dlnode *L);dlnode *current(dlnode *L);void search(dlnode *L);void print(dlnode *L);void searchnum(dlnode *L);void searchname(dlnode *L);void display(dlnode *L) ;void main(){int x;dlnode *L;if(!(L=(dlnode *)malloc(sizeof(dlnode)))) //分配空间{printf("\n");exit(1);}create(L);///调用函数,创建头节点while(1){////////////////////////主菜单///////////////////////////printf(" ============================\n");printf(" 1. 货物出库和入库\n");printf(" 2. 查找货物表\n"); printf(" 3. 显示仓库货物表\n");printf(" 4. 输出到文件\n");printf(" 0. 退出\n");printf(" =============================\n");printf(" 选择0--3:");scanf("%d",&x);switch(x){case 2:search(L);break;//调用查找函数case 1:current(L);break;//调用入库出库函数case 3:display(L);break;//调用显示输出函数case 4:print(L);break;//调用打印函数case 0:printf("\n bye!see you!\n");getchar();getchar();exit(0);//退出程序default:printf("\n Enter erreor!please input 0--4!"); getchar();getchar();}}}dlnode *create(dlnode *L)//创建链表头节点{printf(" 欢迎使用我的仓库管理系统");getchar(); ifempty=0;///////初始化头节点的值////////L->next=NULL;L->prior=NULL;L->number=L->counter=0;strcpy(L->name," "); return L;}void search(dlnode *L) ///查找的主要菜单{int y;if(ifempty==0){printf("没有输入货物!\n");getchar();getchar();return;}else{while(1){printf("=====================\n");printf("1.按编号查询\n");printf("2.按货物名称查询\n");printf("0.返回上一层\n");printf("====================\n");printf("选择0--2:");scanf("%d",&y);switch(y){case 1:searchnum(L);break;//调用按编号查找的函数case 2:searchname(L);break;//调用按名称查找的函数case 0:return;//返回default:printf("enter error!Please input 0--2!\n\n");getchar();getchar();printf("\n\n");}}}}void searchnum(dlnode *L)///按编号查找的函数{int num,flag=0;//flag为是否找到的标志dlnode *head=L;if(ifempty==0){printf("没有货物被输入\n");getchar();getchar();return;}printf("输入你要查找的货物编号:\n");scanf("%d",&num);while((L=L->next)!=head){if(L->number==num){ flag=1;//flag为1时表示找到printf("找到指定编号货物 \n"); printf("\n编号:%d\n",L->number);printf("名称:%s\n",L->name) ;printf("数量:%d\n\n",L->counter); } }if(flag==0)//flag为0时表示没有找到printf("没有找到指定编号货物,请查看是否还有货物。\n");getchar();getchar();}void searchname(dlnode *L)//按名称查找的函数{int flag=0;//flag为是否找到的标志char na[32];dlnode *head=L;if(ifempty==0){printf("没有货物被输入\n");getchar();getchar();return;}printf("输入你要查找的货物名称\n");scanf("%s",&na);while((L=L->next)!=head){if(strcmp(L->name,na)==0){ flag=1;//flag为1时表示找到printf("找到指定名称货物 \n"); printf("\n编号:%d\n",L->number);printf("名称:%s\n",L->name) ;printf("数量:%d\n\n",L->counter); } }if(flag==0)//flag为0时表示没有找到printf("没有找到指定编号货物,请查看是否还有货物。\n\n");getchar();getchar();}dlnode *current(dlnode *L)//货物出库入库函数{int y;while(1){printf("========================\n");printf(" 1.货物入库\n");printf(" 2.货物出库\n");printf(" 0.返回上一层\n");printf("========================\n");printf(" 选择0--2:");scanf("%d",&y);switch(y){case 1:input(L);break;//调用入库函数case 2:output(L);break;//调用出库函数case 0:return(L);//返回上一层default:printf("enter error!Please input 0--2!");getchar();getchar();printf("\n\n");}}}dlnode *input(dlnode *L)//定义入库函数{dlnode *in,*head;head=in=(dlnode *)malloc(sizeof(dlnode));//分配空间head=L;printf("\n请输入货物数据:\n");printf("编号:");scanf("%d",&in->number);printf("名称:");scanf("%s",&in->name);printf("数量:");scanf("%d",&in->counter);if(L->next==NULL) //如果只有头节点,{ //把刚输入的in节点L->next=in; //跟在头节点后面L->prior=in; //in->next=L; //in->prior=L; //ifempty++; //ifempty加1}else{//如果当前L的下一个节点不是头节点while((L=L->next)!=head){//如果输入的数大于L->number,则插到L的前面if(L->number<in->number){in->next=L;in->prior=L->prior; L->prior->next=in;L->prior=in;ifempty++; //ifempty加1return(head);} }//输入的编号比其它编号都小,则插到最后个节点,并首尾相连head->prior->next=in;in->prior=head->prior;head->prior=in;in->next=head;ifempty++; //ifempty加1} return head;}dlnode *output(dlnode *L)//出库的函数{int y;dlnode *head=L;if(ifempty==0)//检测是否有货物输入{printf("没有货物输入系统\n");getchar();getchar();return(head);} while(1){printf("=============\n");printf("1.按编号出库\n");printf("2.按名称出库\n");printf("0.返回上一层\n");printf("==============\n");printf("选择0--2:");scanf("%d",&y);switch(y){case 1:outnum(L);break;//调用按编号出库函数case 2:outname(L);break;//调用按名称出库函数case 0:return(L);default:printf("enter error!Please input 0--2!");getchar();getchar();printf("\n\n");}}} dlnode *outnum(dlnode *L)//按编号出库函数{ int num;dlnode *head=L;printf("请输入出库货物的编号:");scanf("%d",&num);while((L=L->next)!=head){//如果找到就删除节点if(L->number==num){L->prior->next=L->next;L->next->prior=L->prior;ifempty--; //ifempty减1 printf("编号为%d的货物成功出库",num); getchar();getchar();return head; } }printf("没有此编号的货物,请查看是否还有货物。\n\n");getchar();getchar();return (head);}dlnode *outname(dlnode *L)//按名称出库函数{char na[32];dlnode *head=L;printf("请输入出库货物的名称:");scanf("%s",&na);while((L=L->next)!=head){//如果找到就删除节点if(strcmp(L->name,na)==0){L->prior->next=L->next;L->next->prior=L->prior;ifempty--; //ifempty减1 printf("名称为%s的货物成功出库",na);getchar();getchar();return (head);}}printf("没有此名称的货物,请查看是否还有货物。\n\n");getchar();getchar();return(head);} void display(dlnode *L)//显示货物清单{dlnode *head=L;if(ifempty==0){printf("没有货物可显示\n");getchar();getchar();return;}L=L->next;do{ printf("\n编号:%d\n",L->number);printf("名称:%s\n",L->name) ;printf("数量:%d\n\n",L->counter);}while((L=L->next)!=head);getchar();getchar(); }void print(dlnode *L){dlnode *head=L;L=L->next;char filename[max];FILE *out;if(ifempty==0){printf("没有货物可输出\n");getchar();getchar();return;}printf("请输入文件名称:");scanf("%s",filename);if((out=fopen(filename,"w"))==NULL){printf("打开文件失败!\n");getchar();getchar();return;}do{ fprintf(out,"编号:%d\n名称:%s\n数量:%d\n\n",L->number,L->name,L->counter);}while((L=L->next)!=head);printf("输出成功\n");getchar();getchar();fclose(out);}

‘陆’ 用C语言写一个仓库管理系统实现增加、修改、删除、添加等功能

用结构体数组就可以实现增删改查的功能

‘柒’ C语言仓库管理系统

仓库管理系统C语言C++数据结构链表课程设计
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <conio.h>
#define MAX 64
typedef struct node{ /* 定义结构体类型dnode */ int number; /* 货物编号 */ char name[MAX]; /* 货物名称 */ int counter; /* 货物数量 */ struct node *prior,*next; /* 前驱和后继指针 */}dnode;
dnode* head = NULL;
void output_one(dnode* n) /* 输出一条记录 */{ printf("%d\t%s\t%d\n", n->number, n->name, n->counter);}
void output() /* 输出所有记录 */{ dnode* pos = head; if(head == NULL) { return; } while (pos) { output_one(pos); /* 循环调用output_one */ pos = pos->next; }}
int insert() /* 插入一条数据 */{ dnode* pos = head; dnode* n = malloc(sizeof(dnode)); n->prior = NULL; n->next = NULL; printf("请输入货物编号:"); scanf("%d", &n->number); printf("请输入货物名称:"); scanf("%s", n->name); printf("请输入货物数量:"); scanf("%d", &n->counter); if(head==NULL) /* 如果还没有头节点,就作为头节点 */ { head = n; return 1; } while (pos) { if(pos->number > n->number) /* 按顺序查找,如果找到比自己大的,就插在它前面 */ { if(pos->prior) pos->prior->next = n; n->prior = pos->prior; pos->prior = n; if(pos->next) pos->next->prior = n; n->next = pos; return 1; } else if(pos->number == n->number) { free(n); return 0; /* 有重复数据,插入不成功 */ } if (!pos->next) /* 如果已经到链表尾部,插入到后面 */ { pos->next = n; n->prior = pos; return 1; } pos = pos->next;
} return 1;}
void init(){ while (1) /* 初始化,循环插入 */ { insert(); printf("按任意键继续输入,按Esc停止输入\n"); if(getch()==27) break; }}
int delete() /* 删除一条记录 */{ int num; dnode* pos = head; printf("请输入要删除的编号:"); scanf("%d", &num);
if(head == NULL) { return 0; } while (pos) { if(pos->number == num) /* 找到匹配的项 */ { if(pos->prior) pos->prior->next = pos->next; if(pos->next) pos->next->prior = pos->prior; free(pos); return 1; } pos = pos->next; } return 0; // 没找到}
int amend() /* 修改数量 */{ int num, count; dnode* pos = head; printf("请输入要修改的编号:"); scanf("%d", &num); printf("请输入要修改的数量:"); scanf("%d", &count); if(head == NULL) { return 0; } while (pos) { if(pos->number == num) { if (count == 0) /* 如果数量是0,就删除 */ { if(pos->prior) pos->prior->next = pos->next; if(pos->next) pos->next->prior = pos->prior; free(pos); return 1; } pos->counter = count; return 1; } pos = pos->next; } return 0; }
void search() /* 按编号查找 */{ int num; dnode* pos = head;
printf("请输入要查找的编号:"); scanf("%d", &num);
if(head == NULL) { return; } while (pos) { if(pos->number == num) { output_one(pos); /* 找到就打印 */ return; } pos = pos->next; }}
void search_by_name() /* 按名称查找 */{ char name[MAX]; dnode* pos = head; printf("请输入要查找的名称:"); scanf("%s", name);
if(head == NULL) { return; } while (pos) { if(!strcmp(pos->name, name)) output_one(pos); pos = pos->next; }}
int main(){ init(); while (1) { char ch; system("cls"); printf("\t\t\t\ti 增加新货物\n"); printf("\t\t\t\td 删除某种货物\n"); printf("\t\t\t\ta 修改某种货物的数量\n"); printf("\t\t\t\ts 查找指定的货物\n"); printf("\t\t\t\to 输出存货信息\n"); printf("\t\t\t\tq 退出程序\n"); ch = getch(); switch (ch) { case 'i': case 'I': insert(); break;
case 'd': case 'D': delete(); break;
case 'a': case 'A': amend(); break;
case 's': case 'S': printf("1. 按编号查找\n2. 按名称查找\n"); ch = getch(); if(ch == '1') { search(); } else if(ch == '2') { search_by_name(); } break;
case 'o': case 'O': output(); break;
case 'q': case 'Q': return 0; break; } printf("按任意键继续...\n"); getch(); } return 0;}

‘捌’ 怎么用C语言设计一个小型仓库管理系统

你是要接别人的活儿,还是在做课程设计,如果不是必须用c语言的话,还是建议你用VC加数据库,这样更简单 。如果必须只用c语言来做,那你就得定义一系列的结构体,然后把数据存储在文件里。
如何在使用文件函数读写。
你的图有点模糊,只能大体说一下思路。

‘玖’ 求高手帮我用c语言编个简单的商品网站的仓库管理系统 运行环境要sql2005和visual studio 2008的

已发邮箱,满意请给分!~~~

‘拾’ C语言设计仓库管理系统

c语言仓库管理帮实现