标题:材料管理系统
取消只看楼主
王水叮咚
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-11-16
结帖率:100%
 问题点数:0 回复次数:0 
材料管理系统
朋友们帮看一下为什么输入除了a以外的都不能执行定义的函数。今天17号晚上11点前截止,急!
材料管理系统:
调研、选择一个典型仓库材料信息管理案例,实现材料库存、领用信息信息管理。每种材料的记录信息,包括:编号、名称、单价、入库数量、库存数量、出库数量、保管人、进货时间、出货时间和备注等。
#include<stdio.h>
#include<string.h>
#define Maxsize 20
struct material_info {
    int num;
    char name[10];
    float price;
    int innum;
    int kcnum;
    int outnum;
    char bgr[20];
    int intime;
    int outtime;
    char bz[20];
}material[Maxsize];
void input(int);
void display(int);
void modify(int);
void find(int);

void exit(int);
int main()
{
    char i;
   int count=0;
    do
    {
    printf("* * * * * *Menue* * * * * *\n");
    printf("*          a.input        *\n");
    printf("*          b.display      *\n");
    printf("*          c.modify       *\n");
    printf("*          d.find         *\n");
   
    printf("*          f.exit         *\n");
    printf("    Please select a to f   \n");
    printf("* * * * * * * * * * * * * *\n");
    scanf("%c",&i);
    switch(i)
    {
      case 'a': input(count); break;
      case 'b': display(count);break;
      case 'c': modify(count);break;
      case 'd': find(count); break;
      
      case 'f': break;
      default: printf("please select a to f ");
    }
    }while('i'!='f');
    return 0;
}

void input(int count)
{
    int i,num;
    if(count==Maxsize)
    {printf("there is no space!");return;}
    printf("please input the number:");
    scanf("%d",&num);
    for(i=0;i<count;i++)
    if(material[i].num=num)
    {printf("the number is repeat!");return;}
    material[i].num=num;
    printf("please input name:");
    scanf("%s",&material[i].name[10]);
    printf("please input price:");
    scanf("%f",&material[i].price);
    printf("please input store number:");
    scanf("%d",&material[i].innum);
    printf("please input inventory number:");
    scanf("%d",&material[i].kcnum);
    printf("please input deliver number:");
    scanf("%d",&material[i].outnum);
    printf("please input the keeper's name:");
    scanf("%s",&material[i].bgr[20]);
    printf("please input purchase time:");
    scanf("%d",&material[i].intime);
    printf("please input deliver time:");
    scanf("%d",&material[i].outtime);
    printf("please input remark:");
    scanf("%s",&material[i].bz[20]);
    count++;
}

void display(int count)
{
    int i;
    printf("\n");
    printf("num name price num1 num2 num3 keeper time1 time2 remark\n");
    for(i=0;i<count;i++)
    {printf("%d",material[i].num);
    printf("%d",material[i].name[10]);
    printf("%f",material[i].price);
    printf("%d",material[i].innum);
    printf("%d",material[i].kcnum);
    printf("%d",material[i].outnum);
    printf("%s",material[i].bgr[20]);
    printf("%d",material[i].intime);
    printf("%d",material[i].outtime);
    printf("%s",material[i].bz[20]);}
}

void modify(int count)
{
    int i,num,flag=1;
    printf("please input the number that you want to modify:");
    scanf("%d",&num);
    for(i=0;i<count&&flag;i++)
    if(material[i].num==num)
    {
    printf("please input name:");
    scanf("%s",&material[i].name[10]);
    printf("please input price:");
    scanf("%f",&material[i].price);
    printf("please input store number:");
    scanf("%d",&material[i].innum);
    printf("please input inventory number:");
    scanf("%d",&material[i].kcnum);
    printf("please input deliver number:");
    scanf("%d",&material[i].outnum);
    printf("please input the keeper's name:");
    scanf("%s",&material[i].bgr[20]);
    printf("please input purchase time:");
    scanf("%d",&material[i].intime);
    printf("please input deliver time:");
    scanf("%d",&material[i].outtime);
    printf("please input remark:");
    scanf("%s",&material[i].bz[20]);
    flag=0;
    }
    else
    printf("the number you input is not find!");
}

void find(int count)
{
    int i,num,flag=1;
    printf("please input the number that you want to find:");
    scanf("%d",&num);
    for(i=0;i<count&&flag;i++)
    if(material[i].num==num)
    {
    printf("%s",material[i].name[10]);
    printf("%f",material[i].price);
    printf("%d",material[i].innum);
    printf("%d",material[i].kcnum);
    printf("%d",material[i].outnum);
    printf("%s",material[i].bgr[20]);
    printf("%d",material[i].intime);
    printf("%d",material[i].outtime);
    printf("%s",material[i].bz[20]);
    flag=0;
    }
    else
    printf("the number you input is not find!");
}
搜索更多相关主题的帖子: 管理系统 include price 朋友 仓库 
2015-12-17 01:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-460296-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017919 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved