毕业设计,毕业论文代写。联系:elevenor@gmail.com

计算机专业毕业设计,论文,设计代写。电邮:elevenor@gmail.com

用户操作
[即时聊天] [发私信] [加为好友]
tu cID:ctu_85
294100次访问,排名187好友1人,关注者14
Resume
ctu_85的文章
原创 40 篇
翻译 2 篇
转载 6 篇
评论 151 篇
ctu_85的公告
我的邮箱(Contact me):

elevenor@gmail.com

IBM技术中心推荐文章

关于Open Source Project的Eclipse 分段线性骨架 分层模型
最近评论
wanghuaguo:好博客。。。。。。。。
QIQI:同意楼上,你只给第一列的前n个初始化了,殊不知所有的值最后都要从第一列中得到,(3,7)就有1021。
bluehouse1985:Linux 环境下的多核调试
— Intel + Totalview 强强联合!
目前,在软件开发行业,各种性能优异的调试工具层出不穷。但是,它们中的绝大部分都只支持windows环境。即使能支持linux平台,操作起来也很不方便。因此,对于长期在linux上编写程序的开发人员来说,如何调试就成了一个令人头痛的问题!Intel软件 和 Total……
qing:楼主给我发些源代码吧,基于Minimum cut的图像分割,基于Average cut的图像分割,基于Normalize cut的图像分割,用matlabl 实现的。谢谢啦!!1
我的邮箱是qinghappy922@sina.com
qing:楼主给我发些源代码吧,基于Minimum cut的图像分割,基于Average cut的图像分割,基于Normalize cut的图像分割,用matlabl 实现的。谢谢啦!!1
我的邮箱是qinghappy922@sina.com
文章分类
    收藏
    相册
    Forver
    06年从南大到清华
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky

    原创 浙江大学计算机系硕士研究生复试题目解答(2)收藏

    新一篇: 中国科学院2002年一道试题的两种解答 | 旧一篇: 浙江大学计算机系硕士研究生复试题目解答(1)

    谁是开门关门的人?(10分)
    题目要求:
    每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签
    到、签离记录,请根据记录找出当天开门和关门的人。
    具体的输入输出格式规定如下:
    输入格式:测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。
    每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为


    证件号码签到时间签离时间

    其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。
    输出格式:对每一天的记录输出1行,即当天开门和关门人的证件号码,中间用1空格分隔。
    注意:在裁判的标准测试输入中,所有记录保证完整,每个人的签到时间在签离时间之前,
    且没有多人同时签到或者签离的情况。

    要求完整的输入输出如下:

    输入:

    结果:

    源代码如下:

    /*  zju.h

        Copyright (c) 2002, 2006 by ctu_85
        All Rights Reserved.
    */
    #include "stdio.h"
    #include "string.h"
    #include "malloc.h"
    #define idlength 15
    struct Person
    {
    char id[idlength+1];
    char Log[10];
    char Leave[10];
    };
    struct Day
    {
    Person *work;
    int number;
    };
    struct Day *CreateDayLog(int);
    struct Person *CreatePersonLog(int);
    int Process(struct Person *,char *);
    struct Person *Earliest(struct Day*);
    struct Person *Latiest(struct Day*);

    int main()
    {
    int i,j,k;
    Day *process;
    Person *p;
    printf("\nPlease Enter The Days:");
    scanf("%d",&i);
    process=CreateDayLog(i);
    for(j=0;j<i;j++)
    {
    printf("\nIn %dth day:\n",j+1);
    if((process+j)->number!=0)
    {
    p=Earliest(process+j);
    printf("The earliest user and his info is:\n");
    printf("%s,%s,%s",p->id,p->Log,p->Leave);
    printf("\n");
    p=Latiest(process+j);
    printf("The latiest user and his info is:\n");
    printf("%s,%s,%s",p->id,p->Log,p->Leave);
    }
    else
    printf("There is no user that day!\n");
    }
    return 1;
    }
    struct Day *CreateDayLog(int i)
    {
    int j,k;
    struct Day *day=(struct Day *)malloc(i*sizeof(struct Day));
    for(j=0;j<i;j++)
    {
    printf("\nThe number of users of the %dth day",j+1);
    scanf("%d",&k);
    (day+j)->number=k;
    (day+j)->work=CreatePersonLog(k);
    }
    return day;
    }
    struct Person *CreatePersonLog(int i)
    {
    int j;
    Person *user=(struct Person*)malloc(sizeof(struct Person)*i);
    char detail[idlength+20],*t;
    gets(detail);
    for(j=0;j<i;j++)
    {
    printf("\nThe deatails of the %dth person\n",j+1);
    t=gets(detail);
    Process(user+j,t);
    }
    return user;
    }
    int Process(struct Person *p,char *c)
    {
    int i=0,j=0,k=0,status=0;
    char time[8];
    for(;*c!='\0';c++)
    {
    if(*c==' ')
    {
    if(status==0)
    {
    p->id[i]='\0';
    status++;
    continue;
    }
    if(status==1)
    status++;
    }
    if(*c!=' ')
    {
    if(status==0)  /* Now meets the id */
    {
    p->id[i]=*c;
    i++;
    }
    else
    if(status==1)  /*Now meets the log time */
    {
    p->Log[j]=*c;
    j++;
    }
    else
    if(status==2)  /*Now meets the leave time */
    {
    p->Leave[k]=*c;
    k++;
    }
    }
    }
    p->id[i]=p->Log[j]=p->Leave[k]='\0';
    }
    struct Person *Earliest(struct Day* day)
    {
    int minhour=25,minminute=61,minsecond=61;
    int i,early,temphour,tempminu,tempsec;
    struct Person *p=day->work,*result;
    result=p;
    for(i=0;i<day->number;i++,p++)
    {
    temphour=(p->Log[0]-'0')*10+(p->Log[1]-'0');
    tempminu=(p->Log[3]-'0')*10+(p->Log[4]-'0');
    tempsec=(p->Log[6]-'0')*10+(p->Log[7]-'0');
    if(temphour<minhour)
    {
    minhour=temphour;
    minminute=tempminu;
    minsecond=tempsec;
    early=i;
    }
    else if(temphour==minhour&&tempminu<minminute)
    {
    minminute=tempminu;
    minsecond=tempsec;
    early=i;
    }
    else if(temphour==minhour&&tempminu==minminute&&tempsec<minsecond)
    {
    minsecond=tempsec;
    early=i;
    }
    }
    return result+early;
    }
    struct Person *Latiest(struct Day* day)
    {
    int maxhour=-23,maxminute=-59,maxsecond=-59;
    int i,late,temphour,tempminu,tempsec;
    struct Person *p=day->work,*result;
    result=p;
    for(i=0;i<day->number;i++,p++)
    {
    temphour=(p->Leave[0]-'2')*10+(p->Leave[1]-'3');
    tempminu=(p->Leave[3]-'5')*10+(p->Leave[4]-'9');
    tempsec=(p->Leave[6]-'5')*10+(p->Leave[7]-'9');
    if(temphour>maxhour)
    {
    maxhour=temphour;
    maxminute=tempminu;
    maxsecond=tempsec;
    late=i;
    }
    else if(temphour==maxhour&&tempminu>maxminute)
    {
    maxminute=tempminu;
    maxsecond=tempsec;
    late=i;
    }
    else if(temphour==maxhour&&tempminu==maxminute&&tempsec>maxsecond)
    {
    maxsecond=tempsec;
    late=i;
    }
    }
    return result+late;
    }

    了解更多浙大研究生复试解答请点击

    http://blog.csdn.net/ctu_85/archive/2006/10/15/1334936.aspx
    http://blog.csdn.net/ctu_85/archive/2006/10/30/1357145.aspx
    http://blog.csdn.net/ctu_85/archive/2006/10/31/1357794.aspx

    浙江大学ACM试题解答(四月)
    http://blog.csdn.net/ctu_85/archive/2007/04/24/1576831.aspx
    浙江大学ACM试题解答(三月)
    http://blog.csdn.net/ctu_85/archive/2007/03/20/1535556.aspx
    麻省理工算法导论翻译
    http://blog.csdn.net/ctu_85/archive/2007/06/08/1643179.aspx
    华容道游戏与算法
    http://blog.csdn.net/ctu_85/archive/2007/05/15/1610722.aspx
    中国象棋对战程序C语言源代码
    http://blog.csdn.net/ctu_85/archive/2007/05/04/1596351.aspx

    软件可行性报告
    http://blog.csdn.net/ctu_85/archive/2006/06/06/775894.aspx
    软件需求分析报告
    http://blog.csdn.net/ctu_85/archive/2006/06/06/775892.aspx


    发表于 @ 2006年10月16日 03:08:00|评论(loading...)|编辑

    新一篇: 中国科学院2002年一道试题的两种解答 | 旧一篇: 浙江大学计算机系硕士研究生复试题目解答(1)

    评论:没有评论。

    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © ctu_85