| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 797 人关注过本帖, 1 人收藏
标题:医院管理
只看楼主 加入收藏
xs_cctv
Rank: 1
来 自:湖南
等 级:新手上路
帖 子:21
专家分:0
注 册:2008-8-19
结帖率:100%
收藏(1)
 问题点数:0 回复次数:5 
医院管理
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include <conio.h>
//#include<time.h>
    struct  yishen //医生资料结构体
{
    char  names[20];
    char  zhuang[60];
}h[6]={{"午夜","眼科"},
{"横行","外科"},
{"霸道","内科"},
{"冷漠","神经科"},
{"依旧","妇产科"},
{"万骨","骨科"}};
    int i=0;
struct  binren //病人资料结构体
{
    char  name[20];
    int year;
    int month;
    int day;
    char  ruys[30];
    int  shif;
}z[20]={{"风蓝泪",2002,12,4,"神经受损",1},
{"雨剑",2006,10,26,"感冒", 0},
{"冰皇",2005,12,22,"肺炎", 1},
{"十六",2006,11,5,"白血病",1},
{"无惟",2006,12,22,"骨折", 1,}};
struct pp
{
    char names[20];
    int years;
    int months;
    int days;
    char p[20];
}pk[100];
struct  yaopin  //药品资料结构体
{
    int  bianhao;
    char  name[20];
    float  danjia;

}y[8]={{1,"复方阿司匹林片",18.0},
{2,"头孢派酮钠",   35.0},
{3,"拉米夫定",     131.0},
{4,"碳酸钙维D",    246.0},
{5,"复方a-酮酸",   332.0},                  
{6,"复方氨基酸",   59.0},
{7,"阿法骨化醇",   444.0},
{8,"阿托伐他汀",   284.0},
};
struct    mengzhen //门诊位置结构体  
{
    char name[20];
    int  loucen;
    char yishen[20];
}m[6]={{"外科",1,"张飞"},
{"内科",2,"貂禅"},
{"眼科",3,"黄冲"},
{"骨科",4,"关羽"},
{"妇产科",5,"赵云"},
{"神经科",6,"诸葛亮"},
};

void wang();
void guahao();
void xianshi();
void xuanze();
void chakan();
void binfang();
void dangan();
void huajia();
void feiyong();
void date();
void  main()
{
    char ch;
    int  a ;
    int  k;
    char w[10];
    char r[6];

    system("color 2E");
    void date();
    printf("\n\n\n\t\t※※※※※※※※※※※※※※※※※※※※※※※※※\n");
    printf("\t\t※                                              ※\n");   //界面1
    printf("\t\t※                                              ※\n");
    printf("\t\t※            请进入医院管理系统                ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※                                        ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※※※※※※※※※※※※※※※※※※※※※※※※※\n\n\n\n");
    printf("按ENTER键进入下一界面。。。→");
    fflush(stdin);
    scanf("%c",&ch);
    wang();
    //printf("按ENTER键进入下一界面。。。→");
    fflush(stdin);
    //scanf("%c",&ch);
    do{
        system("cls");
        system("color 2E");
        date();
            for(k=0;k<10000000;k++)
            {
                if(k%340000==0)
                    printf(">");
            }
        printf("\n\n\n\t\t\t");
        printf("\t\t                                                \n"); //界面2
        printf("\t\t        欢迎使用本系统!!!               \n");
        printf("\n\n\t\t          请输入您的登陆帐号:   ");
        fflush(stdin);
        gets(w);
        printf("\n\n\t\t          请输入您的密码:   ");
        for(k=0;k<6;k++)
        {
            fflush(stdin);
            r[k]=getch();
            printf("*");
        }
        r[6]='\0';
        fflush(stdin);
        scanf("%c",&ch);
        printf("\t\t                                                \n");
        printf("\t\t                     \n");
        printf("\n\t\t\t");
        for(k=0;k<10000000;k++)
            {
                if(k%340000==0)
                    printf(">");
            }
        if(strcmp(w,"123")!=0||strcmp("123456",r)!=0)
        {
            printf("\n\n\t\t您输入的登陆帐号或密码不正确,请重新输入:\n\n");
            printf("\t\t按ENTER键进入重新输入界面。。。→");
            fflush(stdin);
            scanf("%c",&ch);
        }
    }while(strcmp(w,"123")!=0||strcmp("123456",r)!=0);
    do{
        wang();
        printf("\n\n按ENTER键进入/返回主菜单→:");
        fflush(stdin);
        scanf("%c",&ch);
        system("cls");                                                        //清屏
        system("color 57");


 
        void date();
        printf("\n\n\t\t★★★★★★★★★★★★★★★★★★★★★★\n");               //主菜单界面(界面3)
        printf("\t\t●                                       ●\n");
        printf("\t\t●      ◆  1、 挂号                     ●\n");
        printf("\t\t●      ◆  2、 显示所有门诊             ●\n");
        printf("\t\t●      ◆  3、 选择门诊类型             ●\n");
        printf("\t\t●      ◆  4、 查看医生资料             ●\n");
        printf("\t\t●      ◆  5、 住院病房选择             ●\n");
        printf("\t\t●      ◆  6、 查看病人档案             ●\n");
        printf("\t\t●      ◆  7、 医生划价                 ●\n");
        printf("\t\t●      ◆  8、 添加病人档案             ●\n");
        printf("\t\t●      ◆  0、 退出程序                 ●\n");
        printf("\t\t●                                       ●\n");
        printf("\t\t★★★★★★★★★★★★★★★★★★★★★★");
        printf("\n\n");
        printf("请选择功能(0-8):→   ");
        fflush(stdin);
        scanf("%d",&a);
            switch(a)
        {
        case  1:
            guahao();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  2:
            xianshi();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  3:
            xuanze();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  4:
            chakan();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  5:
            binfang();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  6:
            dangan();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  7:
            huajia();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  8:
            feiyong();
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            system("cls");
            break;
        case  0:
            system("cls");  
                    break;
            default:
                system("cls");
                printf("\n\n\t您的输入有误,请正确选择功能!!!……");
            
        }
        if(a==0)
        {
            void  date();
            printf("是否真的要退出(y/n)");
            fflush(stdin);
            ch=getchar();
            fflush(stdin);
            if(ch=='y'||ch=='Y')
            {
                void date();
                printf("\n\n\n\t==========================================================\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                      使                         ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t==========================================================\n");
                break;
            }
        }fflush(stdin);
    }while(1);    

}
void wang()
{

}
void date()
{
    printf("当前日期:  ");
    system("date/t");
    printf("当前时间:  ");
    system("time/t");
}
void guahao()
{
    int k;
    printf("请记住你挂的号");
    srand((unsigned)time(NULL));
    //for(i=0;i<1;i++)
        printf("%d",rand()%100);
    //printf("\n");
    //fflush(stdin);
    //scanf("%d",&i);
    //printf("%d",i);
}
void  chakan()
{
    
    int k;
    printf("\t\t\t    以下是医生信息\n");
    printf("\n================================================================================");
    printf("\n\n\t\t  医生姓名\t门诊\t");
    printf("\n\t\t   ------------------------------------");
    for(k=0;k<6;k++)
    {
        printf("\n\t\t   %s \t  %s",h[k].names,h[k].zhuang);
        printf("\n\t\t   ------------------------------------");
    }
    printf("\n\n");
}
    
void  xuanze()
{
    int  q;
    printf("请输入你要的看的门诊:1.普通门诊/2.专家门诊\n");
    scanf("%d",&q);
    if(q==1)
    {
        printf("普通门诊");
    }
    if(q==2)
    {
        printf("专家门诊");
    }

    
}
void  xianshi()
{
        
    int k;
    char s[20];
    printf("\t\t\t    以下是所有门诊信息\n");
    printf("\n================================================================================");
    printf("\n\n\t\t  门诊名\t   楼层\t   医生姓名\t");
    printf("\n\t\t   ------------------------------------");
    for(k=0;k<6;k++)
    {
        printf("\n\t\t   %s \t %d\t %s",m[k].name,m[k].loucen,m[k].yishen);
        printf("\n\t\t   ------------------------------------\n");
    }
        
    printf("请输入你要的门诊:");
    fflush(stdin);
    gets(s);
    fflush(stdin);
    for(k=0;k<=6;k++)
    {
    if(strcmp(s,m[k].name)==0)
    {
        printf("%s   \t  %d   \t   %s",m[k].name,m[k].loucen,m[k].yishen);
        break;
    }
    }
    if(k>=6)
        printf("你输入错误");
    

}
void  binfang()
{
    int w;
        printf("请输入你要病房类型1.普通病房/2.贵宾房\n");
    scanf("%d",&w);
    if(w==1)
    {
        printf("你要的是普通病房\n");
    }
         if(w==2)
         {
             printf("你要的是贵宾房\n");
         }

    
}
void dangan()
{
    //struct  binren  bi[5];

    int f;    
    printf("\t\t\t    以下是所有病人信息\n");
    printf("\n================================================================================");
    printf("\n\n\t\t 病人姓名\t   入院时间\t   病人档案\t  是否出院\t");
    printf("\n\t\t   ------------------------------------");
    for(f=0;f<6;f++)
    {
        printf("\n\t\t   %s \t  %d   %d   %d   %s \t  %d",z[f].name,z[f].year,z[f].month,z[f].day,z[f].ruys,z[f].shif);
        printf("\n\t\t   ------------------------------------");
    }
    for(int j=0;j<i;j++)
        printf("\n\t\t   %s \t %d   %d   %d  \t %s",pk[j].names,pk[j].years,pk[j].months,pk[j].days,pk[j].p);
    printf("\n\n");
    
}
void huajia()
{
        
    int k;
    int f;
    printf("\t\t\t    以下是药品信息\n");
    printf("\n================================================================================");
    printf("\n\n\t\t\t  药品名\t");
    printf("\n\t\t   ------------------------------------");
    for(k=0;k<8;k++)
    {
        printf("\n\t\t   %d \t  %s \t  %.3f",y[k].bianhao,y[k].name,y[k].danjia);
        printf("\n\t\t   ------------------------------------");
    }
    printf("\n\n");
    printf("请输入您的处方单:\n");
    fflush(stdin);
    scanf("%d",&f);
    fflush(stdin);
    
    for(k=0;k<8;k++)
    {
        
    if(f==y[k].bianhao)
    {
        printf("%d  \t   %s   \t   %.3f",y[k].bianhao,y[k].name,y[k].danjia);
        break;
    }
    }
    if(k>=6)
        printf("你输入错误");
}
void feiyong()
{
    
        int j;
        char ch;
        do
        {
        system("cls");                                                    //清屏
        system("color 2E");
        date();
     //for(i=0;i<7;i++)
    // {
        printf("\n\n\t\t请输入病人的信息:");
        printf("\n\t\t姓名:  ");
        fflush(stdin);
        gets(pk[i].names);
        fflush(stdin);
        printf("\n\t\t入院日期:  ");
        fflush(stdin);
        printf("\n\t请输入年:");
        fflush(stdin);
        scanf("%d",&pk[i].years);
        fflush(stdin);
        printf("\n\t请输入月:");
        fflush(stdin);
        scanf("%d",&pk[i].months);
        fflush(stdin);
        printf("\n\t请输入日:");
        scanf("%d",&pk[i].days);
        //printf("%d%d%d",pk[i].years,pk[i].months,pk[i].days);
        fflush(stdin);

        printf("请输入病人的病历:\n");
        gets(pk[i].p);
        i++;
    

    //    scanf("%d",&z[i].shif);
       
        printf("是否继续(y/n)?    ");
        fflush(stdin);
        scanf("%c",&ch);
    }while(ch=='y'||ch=='Y');
}
搜索更多相关主题的帖子: 医院 管理 
2008-09-18 19:53
StarWing83
Rank: 8Rank: 8
来 自:仙女座大星云
等 级:贵宾
威 望:19
帖 子:3951
专家分:748
注 册:2007-11-16
收藏
得分:0 
亲爱的,你听说过什么叫“数据库”么?

专心编程………
飞燕算法初级群:3996098
我的Blog
2008-09-18 21:08
葬烟
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-9-3
收藏
得分:0 
呵呵呵呵,以前dos底下的时候不少人用这种图形化窗口,用文件形式来保管数据。还不错啦,不过,以后还是链接数据库吧
2008-09-18 21:14
lonmaor
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:郑州
等 级:版主
威 望:75
帖 子:2637
专家分:6423
注 册:2007-11-27
收藏
得分:0 
这个不属于图形化窗口吧,顶多算文字菜单。
2008-09-18 21:16
葬烟
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-9-3
收藏
得分:0 
用文字拼成的图形
2008-09-18 22:41
xs_cctv
Rank: 1
来 自:湖南
等 级:新手上路
帖 子:21
专家分:0
注 册:2008-8-19
收藏
得分:0 
数据库
不好意思 我刚刚学玩 C 语言 还没有学数据库!~~~
2008-09-18 22:41
快速回复:医院管理
数据加载中...
 
   



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

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