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

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

更新时间:2010-1-25:  来源:毕业论文
C语言仓库管理系统-数据结构 第4页
  printf("                        *2.Del depend on goodsname\n");
        gotoxy(10,22);
        printf("please choose a number between 1 and 2:");
        scanf("%d",&sel);
        switch(sel)
         {case 1:clrscr( );
            gotoxy(6,6);
            printf("Please input goodsnumber:");
            scanf("%d",&del_num);
            break;
          case 2:clrscr( );
            gotoxy(6,6);
            printf("Please input goodsname:");
            scanf("%s",&name);
            break;
        }
       }while(sel!=1&&sel!=2);
     ptr1=head;
  if(ptr1->num==del_num||(strcmp(ptr1->name,name)==0))
         { head=ptr1->next;
       printf("Success to delect goodsmessage!\n");
          }
   else                           /*判断是否是目标结点*/
   { while(ptr1!=NULL&&ptr1->num!=del_num&&strcmp(ptr1->name,name)!=0)
     {ptr2=ptr1;
      ptr1=ptr1->next;
ptr1->prior=ptr2;
}
    if(ptr1->num==del_num||(strcmp(ptr1->name,name)==0))
      {ptr2->next=ptr1->next;
       ptr1->next->prior=ptr1->prior;
      free(ptr1);
       printf("\nSuccess to delect goodsmessage!\n\n");
      }
   else printf("\nCan't find this goodsmessage!\n\n");
   }
  printf("Cotinue to delect?(yes or no):");
  scanf("%s",judge);
  }while(!strcmp(judge,"yes"));
  clrscr( );
  gotoxy(20,10);
  printf("Delecting 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);
}
 /*查找模块*/
void search( )
{char name[10];
 char judge[10];
 int sel;
 long int sel_num;
 clrscr( );
 gotoxy(18,10);
 printf("Please press searched goods'fliename:");
 head=openfile( );
 if(head==NULL)
  return;
 else
  do
    {do
     {clrscr( );
      gotoxy(5,4);
      printf("Please choose the way to search:");
      gotoxy(1,9);
      printf("                        *1.Search depend on goodsnumber\n");
      printf("                        *1.Search depend on goodsname\n");
      gotoxy(10,22);
      printf("please choose a number between 1 and 2:");
      scanf("%d",&sel);
      switch(sel)
         {case 1:clrscr( );
            printf("Please input goodsnumber:");
            scanf("%ld",&sel_num);
            break;
          case 2:clrscr( );
          printf("Please input goodsname:");
            scanf("%s",name);
            break;
         }
     }while(sel!=1&&sel!=2);
    ptr1=head;
    while(ptr1!=NULL&&ptr1->num!=sel_num&&strcmp(ptr1->name,name)!=0)
         ptr1=ptr1->next;
    if ((ptr1->num==sel_num)||(strcmp(ptr1->name,name)==0))
       {printf("\n     Success to search goodsmessage!\n");
        printf("goodsnumber          goodsname         goodscount\n\n");
        printf(PRINT);
       }
    else
      printf("\nCan't find this goodsmessage!\n\n");
      printf("Cotinue to search?(yes or no):");
      scanf("%s",judge);
    }while(!strcmp(judge,"yes"));
    gotoxy(10,24);
    printf("Please press any key to back to last Menu:");
    getch( );
   }
/*输出模块*/
void print( )
 {int i=1;
  clrscr( );
  gotoxy(18,10);
  printf("Please input printed goods'filename:");
  head=openfile( );
  if(head==NULL)
www.751com.cn  follows:\n");
     printf("goodsnumber          goodsname         goodscount\n\n");
     ptr1=head;
     do
       {printf(PRINT);
        ptr1=ptr1->next;
        if(i/10==1)                 /*超过十行换页*/
         www.751com.cn
          clrscr( );
          gotoxy(0,6);
          printf("goodsnumber goodsname goodscount\n\n");
        }
       i=i+1;
     }while(ptr1!=NULL);
    gotoxy(10,24);
    printf("Please press any key to back to last Menu:");
    getch( );
 }

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

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

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