| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2720 人关注过本帖
标题:!!高人 简单C语言编写图书管理系统 :::大一菜鸟*求高人
只看楼主 加入收藏
laoyang103
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:内蒙古包头
等 级:贵宾
威 望:19
帖 子:3082
专家分:11056
注 册:2010-5-22
收藏
得分:0 
回复 16楼 月下清泉
是啊  你给多少钱  我要的不多  你给我冲30Q币

我去英雄联盟里面买个3150的英雄玩玩   你要的课程设计我保质保量完成

                                         
===========深入<----------------->浅出============
2012-12-15 20:21
zhu224039
Rank: 8Rank: 8
等 级:贵宾
威 望:17
帖 子:862
专家分:792
注 册:2012-7-29
收藏
得分:0 
回复 10楼 TonyDeng
也没见你理过谁

我要成为嘿嘿的黑客,替天行道
2012-12-16 14:12
海之森林
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-12-16
收藏
得分:0 
能教教我吗???
2012-12-16 15:02
yaobao
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:4
帖 子:1854
专家分:4121
注 册:2012-10-25
收藏
得分:5 
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct Book{
    int num;
    char name[30];
    char author[30];
    struct Book *next;
    }book;
book * make(book *head){
    book *p,*q;
    p=(book *)malloc(sizeof(book));
    printf("enter num:");
    fflush(stdin);
    scanf("%d",&p->num);
    fflush(stdin);
    printf("enter name:");
    gets(p->name);
    printf("enter author:");
    gets(p->author);
    p->next=NULL;
    if(head==NULL){head=p;return head;}
    else {q=head;
    while(q->next)q=q->next;
    q->next=p;return head;} }
book * find(book *head,char *s){
    book *p;
    p=head;
    while(p){
    if(!(strcmp(s,p->name)))return p;
    p=p->next; }
    return NULL;
    }
book * del(book *head,book *p){
    book *q;
    q=head;
    if(p==head){
        q=head;head=head->next;
        free(q);return head;}
    while(q->next=p){
    q->next=p->next;
    free(p);return head;}}
book * mod(book *head,book *p){
    while(head==p)continue;
    printf("enter num");
    scanf("%d",&p->num);
    printf("enter name");
    scanf("%s",p->name);
    printf("enter author");
    scanf("%s",p->author);
    return head;}
void xianshi(book *p){
    while(p){
        printf("No.:%d\nname:%s\nauthor:%s\n\n",p->num,p->name,p->author);
        p=p->next;}}
   
main(){
    int x,i,j;
    book *head=NULL,*p;
    char s1[30];
    for(;;){
    printf("=============enter what=================\n");
    printf("\t1:enter book.\n\t2:search book.\n\t3:delete book.\n\t4:modify book.\n\t5:xianshi\n");
    printf("========================================\n");
    fflush(stdin);
    scanf("%d",&x);
    switch(x){
        case 1:head=make(head);break;
        case 2:
        case 3:
        case 4:if(head==NULL){printf("no have any book!\n");break;}
               printf("whitch book");fflush(stdin);
               scanf("%s",s1);p=find(head,s1);
              if(x==2)if(p)printf("NO.:%d\nname:%s\nautor:%s\n",p->num,p->name,p->author);
                        else printf("no find");
              if(x==3)head=del(head,p);
              if(x==4)head=mod(head,p);
              break;
        case 5:xianshi(head);break;
        default:printf("error");
        }
    printf("===========have otherthing?=============");
    printf("\n\t1:you.  0:meiyou\n========================================\n");
    fflush(stdin);
    scanf("%d",&x);
    if(!x)break;
    }
    }
    程序还有问题,楼主自己改改吧

认认真真的学习,踏踏实实的走路:戒骄戒躁!!!
2012-12-16 16:54
chaoge他爹
Rank: 2
等 级:论坛游民
帖 子:26
专家分:24
注 册:2012-11-9
收藏
得分:0 
兄弟,,我也是大一的,劝告你一句,不要这样做,没用,,,
在这里有极大地可能被骂,,,,,,一定得不到代码。。。。
我想你应该看见主页上置顶的文章了吧
2012-12-16 16:58
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:0 
以下是引用zhu224039在2012-12-16 14:12:33的发言:

也没见你理过谁

你的问题是无心无力呀,

授人以渔,不授人以鱼。
2012-12-16 22:45
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:5 
小朱有意见,就发点图吧:
图片附件: 游客没有浏览图片的权限,请 登录注册

图片附件: 游客没有浏览图片的权限,请 登录注册

授人以渔,不授人以鱼。
2012-12-17 12:46
hd520ljh
Rank: 1
等 级:新手上路
帖 子:3
专家分:8
注 册:2012-12-17
收藏
得分:0 
很多参考书上最后都有类似的管理程序,你可以去借鉴一下
2012-12-17 12:52
feiei
Rank: 2
来 自:河北省石家庄
等 级:论坛游民
帖 子:41
专家分:37
注 册:2012-9-15
收藏
得分:0 
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100
int a=0;
struct books
    {
        int shuhao;         //书号
        char shuming[20];   //书名
        char zuozhe[20];    //作者
        char cbs[20];       //出版社
        int  jiage;         //价格   
   
    };
struct books book[N];
   
void luru()  
{   
    int i;
    system("cls");
    for(i=0;i>=0;i++)
    {   char ch;
        printf("~~~~~~~~~~~~~~~开始输入信息~~~~~~~~~~~~~\n");
        printf("请输入书的编号:");
        scanf("%d",&book[i].shuhao);
        printf("\n");
        printf("请输入书名:");
        scanf("%s",&book[i].shuming);
        printf("\n");
        printf("请输作者名:");
        scanf("%s",&book[i].zuozhe);
        printf("\n");
        printf("请输入出版社:");
        scanf("%s",&book[i].cbs);
        printf("\n");
        printf("请输入图书价格:");
        scanf("%d",&book[i].jiage);
        printf("\n");
        getchar( );
        system("cls");
        printf("是否继续输入,请选择\n(1:继续 2:退出):");
        scanf("%d",&ch);
        if(ch==1)
        {
            a++;
        }
        else
        {
            break;
        }
    }      
}
void liulan()
{   
    int i;
    system("cls");
    printf("书号\t书名\t作者\t出版社\t价格\n");
    for(i=0;i<=a;i++)
    {
      printf("%d\t%s\t%s\t%s\t%d\n",book[i].shuhao,book[i].shuming,book[i].zuozhe,book[i].cbs,book[i].jiage);
    }
}
void cx1()//书名查询
{
    int i;
    char name[20];
    system("cls");
    printf("|按书名查询|\n");
    scanf("%s",&name);
    for(i=0;i<=a;i++)
    {
       if(strcmp(name,book[i].shuming)==0)
        {
          printf("书号\t书名\t作者\t出版社\t价格\n");
          printf("%d\t%s\t%s\t%s\t%d\n",book[i].shuhao,book[i].shuming,book[i].zuozhe,book[i].cbs,book[i].jiage);
        }
        if(strcmp(name,book[i].shuming)!=0)
        {
          printf("没有你要的查询结果\n");
        }
    }
}
void cx2()//作者名查询
{
    int i;
    char g[20];
    system("cls");
    printf("|按作者名查询|\n");
    scanf("%s",&g);
    for(i=0;i<=a;i++)
    {
      if(strcmp(g,book[i].zuozhe)==0)
      {
           printf("书号\t书名\t作者\t出版社\t价格\n");
           printf("%d\t%s\t%s\t%s\t%d\n",book[i].shuhao,book[i].shuming,book[i].zuozhe,book[i].cbs,book[i].jiage);
      }
         if(strcmp(g,book[i].zuozhe)!=0)
         {
             printf("没有你要的查询结果\n");
         }
    }
}

void chaxun()//查询
{   
    int x;
    system("cls");
    printf("\n==================================图书信息查询==================================\n");
    printf("**************************************请选择查询方式****************************\n");
    printf("|1.按书名查询|\n");
    printf("|2.按作者名查询|\n");
    sta:printf("请输入你选择:");
    scanf("%d",&x);
    switch(x)
    {
    case 1:cx1();break;//调用cx1函数完成按书名查询
    case 2:cx2();break;//调用cx2函数完成按作者查询
    default :
        {
        printf("输入有误,请重新输入!\n");
        //syetem("cls");
        goto sta;
        break;
        }
    }  
}
void del()//删除
{
   
    char shu[20];
    int i,h,z;
    system("cls");
    fanhui:printf("请你输入想要删除图书的名称:\n");
    fflush(stdin);
    scanf("%s",&shu);//接收书名
    for(i=0;i<=a;i++)
    {
         if(strcmp(shu,book[i].shuming)==0)
         {
              printf("书号\t书名\t作者\t出版社\t价格\n");
              printf("%d\t%s\t%s\t%s\t%d\n",book[i].shuhao,book[i].shuming,book[i].zuozhe,book[i].cbs,book[i].jiage);
              printf("你确定要删除以上信息吗?\n");
              printf("|1.是,确认删除\n");
              printf("|2.否,返回上一层\n");
              printf("|3.否,返回主页\n");
              fflush(stdin);
              scanf("%d",&h);
        if(h==1)
        {
               for(z=i;z<a;z++)
            {
               book[i]=book[i+1];
            }
        }
            if(h==2)
            {
                 system("cls");
                 goto fanhui;
            }
                if(h==3)
                {
                   break;
                }
          printf("信息删除成功\n");   
          a--;
          break;
        }
        if(shu,book[i].shuming!=0)
        {
            printf("没有该书籍信息\n");
            break;
        }
    }
}
void xg()//修改
{
    int i;
    char name[20];
    system("cls");
    printf("|请输入你要修改的书名|\n");
    scanf("%s",&name);
    for(i=0;i<=a;i++)
    {
        if(strcmp(name,book[i].shuming)==0)
        {
            printf("该图书信息为:\n");
            printf("\n");
            printf("\n");
            printf("书号\t书名\t作者\t出版社\t价格\n");
            printf("%d\t%s\t%s\t%s\t%d\n",book[i].shuhao,book[i].shuming,book[i].zuozhe,book[i].cbs,book[i].jiage);
            printf("请重新输入该书籍信息:\n");
            printf("~~~~~~~~~~~~~~~开始输入信息~~~~~~~~~~~~~\n");
            printf("请输入书的编号:");
            scanf("%d",&book[i].shuhao);
            printf("\n");
            printf("请输入书名:");
            scanf("%s",&book[i].shuming);
            printf("\n");
            printf("请输作者名:");
            scanf("%s",&book[i].zuozhe);
            printf("\n");
            printf("请输入出版社:");
            scanf("%s",&book[i].cbs);
            printf("\n");
            printf("请输入图书价格:");
            scanf("%d",&book[i].jiage);
            printf("\n");
    /*        getchar( );
            system("cls");    */
        }
    }            
        if(strcmp(name,book[i].shuming)!=0)
            printf("没有该书籍信息!\n");
}   
   
void main()
{
   
    int n=0,sta=1,shuru;
    while(sta)
    {   
        system("cls");
        {
        printf("\t\t*****************图书信息管理系统*****************\n");
        printf("\t\t*\t\t|1.图书录入                      *\n");
        printf("\t\t*\t\t|2.图书浏览                      *\n");
        printf("\t\t*\t\t|3.图书查询                      *\n");
        printf("\t\t*\t\t|4.图书的删除                    *\n");
        printf("\t\t*\t\t|5.图书修改                      *\n");
        printf("\t\t*\t\t|6.退出系统                      *\n");
        printf("\t\t*****************图书信息管理系统*****************\n\n\n");
        printf("\t\t请输入以上序号进行选择:\n");
        scanf("%d",&shuru);
        }
        switch(shuru)
        {
           case 1:luru(book,n);
                  {
                     system("pause");
                     break;
                  }
           case 2:liulan(book,n);
                  {
                     system("pause");
                     break;  
                  }
           case 3:chaxun(book,n);
                  {
                     system("pause");
                     break;
                  }
           case 4:del(book,n);
                  {
                     system("pause");
                     break;
                  }
           case 5:xg(book,n);
                  {
                      system("pause");
                      break;
                  }
           case 6:exit(0);
                  {
                    system("pause");
                  }
           default :
               {
               printf("输入有误,请重新输入!\n");
               fflush(stdin);
               scanf("%d",&shuru);
               }
        }
    }
}




当时课程设计自己写着玩的你自己改改吧

小白初来。求各种罩。。。。
2013-01-15 22:53
快速回复:!!高人 简单C语言编写图书管理系统 :::大一菜鸟*求高人
数据加载中...
 
   



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

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