毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

C语言仓库管理系统-数据结构 第3页

更新时间:2010-1-25:  来源:毕业论文
C语言仓库管理系统-数据结构 第3页
 do
   {printf("Please input the No.%d goods'%s:\n",n,string1);
    scanf("%ld",&ptr1->num);flushall();
    if(ptr1->num==0)
     {printf("Please press any key to back to last Menu:");
      getch( );
      free(ptr1);
      return(0);
      }
   printf("Please input the No.%d goods'%s:\n",n,string2);scanf("%s",&ptr1->name);
   flushall( );                           /*刷新缓冲区函数*/
   printf("Please input the No.%d goods'%s:\n",n,string3);scanf("%d",&ptr1->count);
   flushall( );
   if(CHECK_COUNT)
   printf("Please input the right goodscount!\n");
   }while(CHECK_COUNT);
  while(ptr1->num!=NULL)
  { if(n==1)
    head=ptr1;
   else ptr2->next=ptr1;
       ptr1->prior=ptr2;
   n=n+1;
   ptr2=ptr1;
   if((ptr1=(COM* )malloc(LEN))==NULL)
     { printf("No enough memory,fail to creat linklist!");
     getch( );
     }
   do
    {printf("Please input the No.%d goods'%s:\n",n,string1);
     scanf("%ld",&ptr1->num);
     flushall( );
     if(ptr1->num==0)
       {ptr1->num=NULL;
        break;}
     printf("Please input the No.%d goods'%s:\n",n,string2);scanf("%s",&ptr1->name);
     flushall( );
     printf("Please input the No.%d goods'%s:\n",n,string3);scanf("%d",&ptr1->count);
     flushall( );
     if(CHECK_COUNT)
     printf("Please input the right goodscount!\n");
    }while(CHECK_COUNT);
  }
  ptr2->next=NULL;
  gotoxy(1,24);
  printf("Finish the inputting of goods'message,press any key to back to last Menu,please save:");
  getch();
  return(head);
}
/*插入模块*/
COM * insert( )
 {COM * ptr3;
  char string1[ ]={"goodsnumber"};
  char string2[ ]={"goodsname"};
  char string3[ ]={"goodscount"};
  char judge[10];
  clrscr( );
  gotoxy(18,10);
  printf("Please input inserted goods'fliename:");
  head=openfile( );
  if(head==NULL)
  return(NULL);
  else
    do
     {clrscr( );
      printf("Please input inserted goods'goodsmessage:\n");
      if((ptr3=(COM*)malloc(LEN))==NULL)
      {printf("No enough memory,fail to creat node!");
       getch();
      }
    do
    {printf("Please input goods'%s(>0):\n",string1);scanf("%ld",&ptr3->num);
     flushall( );
     if(ptr3->num<=0)
       {printf("Error inputting!please choose the inserted goods again\n");
        getch( );return;
       }
    printf("Please input goods'%s:\n",string2);scanf("%s",&ptr3->name);flushall( );
    printf("Please input goods'%s:\n",string3);scanf("%d",&(ptr3->count)); flushall( );
    if(CHECK_COUNT2)
    printf("Please input the right goodscount(>0)!\n");
   }while(CHECK_COUNT2);
    ptr1=head;
    while(ptr1!=NULL)
    {ptr2=ptr1;
     ptr1=ptr1->next;
     ptr1->prior=ptr2;
    }
ptr2->next=ptr3;
ptr3->prior=ptr2;
    ptr3->next=NULL;
    printf("\nInserting success!Cotinue to insert?(yes or no):");
    scanf("%s",judge);
    clrscr( );
  }while(! strcmp(judge,"yes"));
 gotoxy(20,10);
 printf("Inserting success!\n");
 gotoxy(18,11);
 printf("Press any key to back to last Menu\n");
 gotoxy(16,12);
 printf("And make sure to Save(6) them or you will lose them!\n");
 getch( );
 return(head);
}
/*删除模块*/
COM *delet( )
  {char name[10];
   char judge[10];
www.751com.cn
   gotoxy(20,10);
   printf("Please input delected goods'fliename:");
   head=openfile( );
   clrscr( );
   if(head==NULL)
     return(NULL);
   else
    do
     {do
       {clrscr( );
        gotoxy(3,4);
        printf("Please input delected goods'message:");
        gotoxy(1,9);
        printf("                        *1.Del depend on goodsnumber\n");
        gotoxy(1,10);

上一页  [1] [2] [3] [4] [5] [6] 下一页

C语言仓库管理系统-数据结构 第3页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。