| ²é¿´: 445 | »Ø¸´: 2 | |||
ÓÀÔ¶µÄ´ð°¸Òø³æ (СÓÐÃûÆø)
|
[ÇóÖú]
µ÷ÊÔ´íÎó
|
|
µ°ÌÛµÄÊý¾Ý½á¹¹£¬ÎÒÃÇÃ÷Ã÷ÊÇÊýѧϵµÄ£¬½á¹û»¹Òª×öÊý¾Ý½á¹¹µÄ¿Î³ÌÉè¼Æ£¬ÎÒÃÇֻѧÁ˶þÊ®¼¸½Ú¿ÎºÃ²»ºÃ£¬Êý¾Ý½á¹¹±à³Ì²»»áѽ£¡ÀÏʦҪÇ󻹺ÃÑÏ¿Á£¬ÒªÇóÕâ¸öÐÇÆÚÎåÒª×öÍֻ꣬ºÃÔÚÍøÉÏÏÂÁËһƪ£¬È»ºó×Ô¼ºÔÙ¸ÄÁ˸ģ¬ÒѾ¸ÄÁËÒ»¸öÐÇÆÚÁË£¬¿öÇÒÎÒÃÇ»¹Óкü¸ÃÅ¿¼ÊÔÄØ£¬²»¿ÓÄܰÑËùÓеÄʱ¼ä¶¼·ÅÖÃÔÚÕâÉÏÃæ¡£¿ÉÊÇÕâһƪ×ÜÊÇÓдíÎ󣬵÷ÊÔµÄʱºò×ÜÊǵ÷ÊÔ²»³É¹¦£¬ÄÇλ´óÉñ°ï°ïæ¸ø¸Ä¸Äߣ¡ÎÒÖ»ÓÐ34½ð±Ò£¬È«²¿¸øÄãÁË¡£ ÌâÄ¿ÊÇÍ£³µ³¡¹ÜÀíϵͳ¡£ÀûÓÃÕ¾ºÍ¶ÓÁÐʵÏֵģ¡ #include #include #include #include #define Size 3 /*³µ¿âÈÝÁ¿*/ #define Price 5 /*µ¥Î»¼Û¸ñ*/ #define Null 0 typedef struct time { int hour; int minute; }Time; typedef struct { int car_number; Time arrivetime,leavetime; /*³µÐÅÏ¢½áµã*/ float fee; }car_info; typedef struct { car_info *north; car_info *south; /*Í£³µ³¡ÐÅÏ¢*/ int number; }car_park; typedef struct { car_info *west; car_info *east; /*µ¹³µ³¡ÐÅÏ¢*/ int number; }car_park_back; typedef struct car { car_info *data; struct car *next; /*½áµãÐÅÏ¢*/ }carnode; typedef struct node { carnode *head; carnode *rear; /*±ãµÀÐÅÏ¢*/ int number; }car_park_temp; void init_car_park(car_park *cp) { cp->north=(car_info *)malloc(Size * sizeof(car_info)); /*³õʼ»¯Í£³µ³¡*/ if(!cp->north) printf("error\n" ;cp->south=cp->north; /*ÁîÕ»¶¥µÈÓÚÕ»µ×*/ cp->number=0; } void enter_car_park(car_park *cp,car_info *car) { *cp->south++=*car; /*³µÁ¾½øÈëÍ£³µ³¡*/ cp->number++; } int notfull_car_park(car_park *cp) { int e; if(cp->south-cp->north>=Size) /*ÅжÏÍ£³µ³¡ÊÇ·ñÒÑÂú*/ e=0; else e=1; return(e); } int notempty_car_park_back(car_park_back *cpb) { int e; if(cpb->east==cpb->west) e=0; /*Åжϵ¹³µ³¡ÊÇ·ñ²»¿Õ*/ else e=1; return(e); } void back_car_park(car_park *cp,car_info *car) { *car=*cp->south; /*½øÐе¹³µ²Ù×÷*/ cp->number--; } void init_car_park_back(car_park_back *cpb) { cpb->west=(car_info *)malloc(Size *sizeof(car_info)); if(!cpb->west) printf("error\n" ; /*µ¹³µ³¡³õʼ»¯*/cpb->east=cpb->west; cpb->number=0; } void enter_car_park_back(car_park_back *cpb,car_info *car) { *cpb->east++=*car; cpb->number++; /*½øÈëµ¹³µ³¡²Ù×÷*/ } void leave_car_park_back(car_park_back *cpb,car_info *car) { *car=*--cpb->east; cpb->number--; /*À뿪µ¹³µ³¡²Ù×÷*/ } void init_car_park_temp(car_park_temp *cpt) { cpt->head=cpt->rear=(carnode *)malloc(sizeof(carnode)); /*³õʼ»¯±ãµÀ*/ cpt->head->next=Null; cpt->number=0; } void enter_car_park_temp(car_park_temp *cpt,car_info *car) { carnode *p; p=(carnode *)malloc(sizeof(carnode)); /*½øÈë±ãµÀ²Ù×÷*/ p->data=car; p->next=Null; cpt->rear->next=p; cpt->rear=p; cpt->number++; } void leave_car_park_temp(car_park_temp *cpt,car_info *car,car_park *cp) { carnode *h; h=(carnode *)malloc(sizeof(carnode)); h=cpt->head->next; car=h->data; /*À뿪±ãµÀ²Ù×÷*/ cpt->head->next=h->next; enter_car_park(cp,car); cpt->number--; } int notempty_car_park_temp(car_park_temp *cpt) { int e; if(cpt->head==cpt->rear) /*ÅжϱãµÀÊÇ·ñΪ¿Õ*/ e=0; else e=1; return(e); } void leave_car_park(car_park *cp,car_info *car,car_park_back *cpb) { float e,a1,a2,b1,b2,t; /*¶¨Òåʱ¼ä±äÁ¿*/ car_info *car1,*car2; car1=(car_info *)malloc(sizeof(car_info)); /*³µÁ¾ÊµÌ廯*/ car2=(car_info *)malloc(sizeof(car_info)); while((--cp->south)->car_number!=car->car_number) /*ÅжϳµºÅÊÇ·ñΪҪ³öÈ¥µÄ³µºÅ*/ { back_car_park(cp,car1); /*½øÐе¹³µ²Ù×÷*/ enter_car_park_back(cpb,car1); /*½øÈëµ¹³µ³¡*/ } car->arrivetime.hour=cp->south->arrivetime.hour; car->arrivetime.minute=cp->south->arrivetime.minute; a1=car->arrivetime.hour; a2=car->arrivetime.minute; b1=car->leavetime.hour; b2=car->leavetime.minute; t=((b1-a1)+(b2-a2)/60); car->fee=t*Price; /*¼ÆËã¼Û¸ñ*/ printf("the time of the car is %2.1f hour ,%2.1f minute",(b1-a1),(b2-a2)); printf("the money is %3.1f yuan",car->fee); e=notempty_car_park_back(cpb); /*Åжϵ¹³µ³¡ÊÇ·ñΪ¿Õ*/ while(e==1) { leave_car_park_back(cpb,car2); /*À뿪µ¹³µ³¡*/ enter_car_park(cp,car2); /* ½øÈëÍ£³µ³¡*/ e=notempty_car_park_back(cpb); /*Åжϵ¹³µ³¡ÊÇ·ñΪ¿Õ*/ } cp->number--; } void main() /*Ö÷º¯Êý*/ { char ch; int e,n,i; /*¶¨Òå×Ö·ûºÍÕûÐαäÁ¿*/ car_park_back *cpb; /* ¶¨ÒåÍ£³µ³¡£¬µ¹³µ³¡ÒÔ¼°±ãµÀµÄ±äÁ¿*/ car_park *cp; car_park_temp *cpt,*cpt2; car_info *car; cp=(car_park *)malloc(sizeof(car_park)); /*ʵÌ廯±äÁ¿*/ cpb=(car_park_back *)malloc(sizeof(car_park)); cpt=(car_park_temp *)malloc(sizeof(car_park_temp)); cpt2=(car_park_temp *)malloc(sizeof(car_park_temp)); init_car_park(cp); /*ʵÌ廯ͣ³µ³¡£¬µ¹³µ³¡£¬±ãµÀ*/ init_car_park_back(cpb); init_car_park_temp(cpt); printf("\nA=³µÁ¾µ½´ï L=³µÁ¾À뿪 X=³µ³¡ÐÅÏ¢\n" ;car=(car_info *)malloc(sizeof(car_info)); do { printf("input the 'A' or 'L' or 'X' :" ; /*ÊäÈë´ý²Ù×÷µÄÃüÁî*/scanf("%s",&ch); e=notfull_car_park(cp); /*Åжϳµ³¡ÊÇ·ñΪ¿Õ*/ switch(ch) /*ÅжÏÒªÊäÈëµÄÃüÁî*/ { case 'A': if(e==1) /*³µ³¡²»Âú£¬½øÈë³µÁ¾*/ { printf("input the car_number:" ; /*ÊäÈë³µÁ¾µÄ»ù±¾ÐÅÏ¢*/scanf("%s",&car->car_number); printf("input the arrivetime:" ;scanf("%d",&(*car).arrivetime.hour); scanf("%d",&(*car).arrivetime.minute); enter_car_park(cp,car); /*½øÈë³µ³¡*/ printf("the car is in the car_park,the place is %d\n",cp->number); } else /*Èô³µ³¡Âú£¬½øÈë±ãµÀ*/ { enter_car_park_temp(cpt,car); printf("input the car_number:" ;scanf("%c",&car->car_number); printf("the car is in the car_park_temp,the place of temp is %d\n",cpt->number); } break; case 'L': /*À뿪ͣ³µ³¡*/ printf("input the car_number:" ; /*ÊäÈëÒªÀ뿪³µÁ¾µÄºÅÂëÒÔ¼°À뿪ʱ¼ä*/scanf("%s",&car->car_number); printf("input the leavetime of the car:" ;scanf("%d",&(*car).leavetime.hour); scanf("%d",&(*car).leavetime.minute); leave_car_park(cp,car,cpb); /*Ö´ÐÐÀ뿪³µ³¡*/ i=(*car).leavetime.hour; /*Áî±ãµÀÀï³µÁ¾½øÈë³µ³¡µÄʱ¼äºÍ³µ³¡ÀïÃæµÄ³µÀ뿪µÄʱ¼äÏàµÈ*/ n=notempty_car_park_temp(cpt); /*ÅжϱãµÀÊÇ·ñ²»¿Õ*/ if(n==1) printf("The car %s",cpt->head->next->data->car_number); /*¼Çס±ãµÀÀïµÚÒ»Á¾³µµÄºÅÂë*/ leave_car_park_temp(cpt,car,cp); /*À뿪±ãµÀ£¬½øÈëÍ£³µ³¡*/ printf(" is enter the car_park,arrivetime is %d ,the place of carpark is %d\n",i,cp->number); break; case 'X': /*²é¿´³µ³¡ÒÔ¼°±ãµÀÀïµÄ³µÁ¾ÐÅÏ¢*/ printf("\nThere are %d cars in car park!\nFolowing is the carnumber in the car park:\n ",cp->number); for(i=1;i<=cp->number;i++) /*×öÑ»·£¬ÒÀ´ÎÊä³öÍ£³µ³¡Àï³µÁ¾µÄÐÅÏ¢*/ printf("%s,",(cp->north++)->car_number); cp->north=cp->north-cp->number; cpt2->head=cpt->head->next; /*ÉèÒ»¸öÐéÄâÖ¸ÕëʹÆäÖ¸ÏòÍ·½áµãµÄÏÂÒ»¸öλÖÃ*/ if(cpt->number==0) /*±ãµÀÀïûÓгµµÄÇé¿ö*/ printf("\nThere is no cars in temp!" ;else { printf("There are %d cars in car temp!\n Folowing is the carnumber in the car temp:\n ",cpt->number); for(i=1;i<=cpt->number;i++) /*×öÒ»¸öÑ»·£¬Êä³ö±ãµÀÀï³µÁ¾µÄÐÅÏ¢*/ { printf("%d ",cpt2->head->next->data->car_number); /* Êä³ö³µÁ¾µÄºÅÂë*/ cpt2->head=cpt2->head->next; } } break; default: printf("ERROR please input again\n" ;break; } } while(ch!='0'); } |
» ²ÂÄãϲ»¶
Ò»Ö¾Ô¸aÇø211£¬085601-307·ÖÇóµ÷¼Á
ÒѾÓÐ25È˻ظ´
Çó²ÄÁϵ÷¼Á£¬Ò»Ö¾Ô¸Ö£ÖÝ´óѧ289·Ö
ÒѾÓÐ5È˻ظ´
271·ÖÇóµ÷¼ÁѧУ
ÒѾÓÐ4È˻ظ´
×Ü·Ö328ÉúÎïÓëÒ½Ò©¿¼ÊýѧÇóµ÷¼Á
ÒѾÓÐ4È˻ظ´
Ò»Ö¾Ô¸ÉÂÎ÷ʦ·¶´óѧÉúÎïѧ317·Ö
ÒѾÓÐ5È˻ظ´
315·Ö 085602 Çóµ÷¼Á
ÒѾÓÐ11È˻ظ´
298·Ö 070300Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
Ò»Ö¾Ô¸°²»Õ´óѧ0817»¯Ñ§¹¤³ÌÓë¼¼Êõ£¬Çóµ÷¼Á
ÒѾÓÐ12È˻ظ´
265Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
085600²ÄÁÏÓ뻯¹¤µ÷¼Á
ÒѾÓÐ20È˻ظ´
á°Îí
ľ³æ (ÕýʽдÊÖ)
- Ó¦Öú: 15 (СѧÉú)
- ½ð±Ò: 1710.7
- É¢½ð: 7
- Ìû×Ó: 365
- ÔÚÏß: 177.2Сʱ
- ³æºÅ: 1298397
- ×¢²á: 2011-05-17
- ÐÔ±ð: GG
- רҵ: ¼ÆËãÊýѧÓë¿ÆÑ§¹¤³Ì¼ÆËã
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
xzhdty(½ð±Ò+1): »¶Ó³£À´³ÌÐòÓïÑÔ¿´¿´ 2011-12-19 19:59:29
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:54
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:55
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:55
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:56
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:57
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:58
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:59
ÓÀÔ¶µÄ´ð°¸(½ð±Ò+1): ûÓаïÖú£¬ 2011-12-22 12:28:02
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
xzhdty(½ð±Ò+1): »¶Ó³£À´³ÌÐòÓïÑÔ¿´¿´ 2011-12-19 19:59:29
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:54
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:55
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:55
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:56
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:57
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:58
jjdg:±à¼ÄÚÈÝ 2011-12-20 01:59
ÓÀÔ¶µÄ´ð°¸(½ð±Ò+1): ûÓаïÖú£¬ 2011-12-22 12:28:02
|
#include #include #include #include #define Size 3 /*³µ¿âÈÝÁ¿*/ #define Price 5 /*µ¥Î»¼Û¸ñ*/ #define Null 0 typedef struct time { int hour; int minute; }Time; typedef struct { int car_number; Time arrivetime,leavetime; /*³µÐÅÏ¢½áµã*/ float fee; }car_info; typedef struct { car_info *north; car_info *south; /*Í£³µ³¡ÐÅÏ¢*/ int number; }car_park; typedef struct { car_info *west; car_info *east; /*µ¹³µ³¡ÐÅÏ¢*/ int number; }car_park_back; typedef struct car { car_info *data; struct car *next; /*½áµãÐÅÏ¢*/ }carnode; typedef struct node { carnode *head; carnode *rear; /*±ãµÀÐÅÏ¢*/ int number; }car_park_temp; void init_car_park(car_park *cp) { cp->north=(car_info *)malloc(Size * sizeof(car_info)) ; /*³õʼ»¯Í£³µ³¡*/ if(!cp->north) printf("error\n" ) ; cp->south=cp->north; /*ÁîÕ»¶¥µÈÓÚÕ»µ×*/ cp->number=0; } void enter_car_park(car_park *cp,car_info *car) { *cp->south++=*car; /*³µÁ¾½øÈëÍ£³µ³¡*/ cp->number++; } int notfull_car_park(car_park *cp) { int e; if(cp->south-cp->north>=Size) /*ÅжÏÍ£³µ³¡ÊÇ·ñÒÑÂú*/ e=0; else e=1; return(e); } int notempty_car_park_back(car_park_back *cpb) { int e; if(cpb->east==cpb->west) e=0; /*Åжϵ¹³µ³¡ÊÇ·ñ²»¿Õ*/ else e=1; return(e); } void back_car_park(car_park *cp,car_info *car) { *car=*cp->south; /*½øÐе¹³µ²Ù×÷*/ cp->number--; } void init_car_park_back(car_park_back *cpb) { cpb->west=(car_info *)malloc(Size *sizeof(car_info)); if(!cpb->west) printf("error\n" ) ; /*µ¹³µ³¡³õʼ»¯*/ cpb->east=cpb->west; cpb->number=0; } void enter_car_park_back(car_park_back *cpb,car_info *car) { *cpb->east++=*car; cpb->number++; /*½øÈëµ¹³µ³¡²Ù×÷*/ } void leave_car_park_back(car_park_back *cpb,car_info *car) { *car=*--cpb->east; cpb->number--; /*À뿪µ¹³µ³¡²Ù×÷*/ } void init_car_park_temp(car_park_temp *cpt) { cpt->head=cpt->rear=(carnode *)malloc(sizeof(carnode)) ; /*³õʼ»¯±ãµÀ*/ cpt->head->next=Null; cpt->number=0; } void enter_car_park_temp(car_park_temp *cpt,car_info *car) { carnode *p; p=(carnode *)malloc(sizeof(carnode)) ; /*½øÈë±ãµÀ²Ù×÷*/ p->data=car; p->next=Null; cpt->rear->next=p; cpt->rear=p; cpt->number++; } void leave_car_park_temp(car_park_temp *cpt,car_info *car,car_park *cp) { carnode *h; h=(carnode *)malloc(sizeof(carnode)) ; h=cpt->head->next; car=h->data; /*À뿪±ãµÀ²Ù×÷*/ cpt->head->next=h->next; enter_car_park(cp,car); cpt->number--; } int notempty_car_park_temp(car_park_temp *cpt) { int e; if(cpt->head==cpt->rear) /*ÅжϱãµÀÊÇ·ñΪ¿Õ*/ e=0; else e=1; return(e); } void leave_car_park(car_park *cp,car_info *car,car_park_back *cpb) { float e,a1,a2,b1,b2,t; /*¶¨Òåʱ¼ä±äÁ¿*/ car_info *car1,*car2; car1=(car_info *)malloc(sizeof(car_info)); /*³µÁ¾ÊµÌ廯*/ car2=(car_info *)malloc(sizeof(car_info)); while((--cp->south)->car_number!=car->car_number) /*ÅжϳµºÅÊÇ·ñΪҪ³öÈ¥µÄ³µºÅ*/ { back_car_park(cp,car1); /*½øÐе¹³µ²Ù×÷*/ enter_car_park_back(cpb,car1); /*½øÈëµ¹³µ³¡*/ } car->arrivetime.hour=cp->south->arrivetime.hour; car->arrivetime.minute=cp->south->arrivetime.minute; a1=car->arrivetime.hour; a2=car->arrivetime.minute; b1=car->leavetime.hour; b2=car->leavetime.minute; t=((b1-a1)+(b2-a2)/60); car->fee=t*Price; /*¼ÆËã¼Û¸ñ*/ printf("the time of the car is %2.1f hour ,%2.1f minute",(b1-a1),(b2-a2)); printf("the money is %3.1f yuan",car->fee); e=notempty_car_park_back(cpb); /*Åжϵ¹³µ³¡ÊÇ·ñΪ¿Õ*/ while(e==1) { leave_car_park_back(cpb,car2); /*À뿪µ¹³µ³¡*/ enter_car_park(cp,car2); /* ½øÈëÍ£³µ³¡*/ e=notempty_car_park_back(cpb); /*Åжϵ¹³µ³¡ÊÇ·ñΪ¿Õ*/ } cp->number--; } void main() /*Ö÷º¯Êý*/ { char ch; int e,n,i; /*¶¨Òå×Ö·ûºÍÕûÐαäÁ¿*/ car_park_back *cpb; /* ¶¨ÒåÍ£³µ³¡£¬µ¹³µ³¡ÒÔ¼°±ãµÀµÄ±äÁ¿*/ car_park *cp; car_park_temp *cpt,*cpt2; car_info *car; cp=(car_park *)malloc(sizeof(car_park)); /*ʵÌ廯±äÁ¿*/ cpb=(car_park_back *)malloc(sizeof(car_park)); cpt=(car_park_temp *)malloc(sizeof(car_park_temp)); cpt2=(car_park_temp *)malloc(sizeof(car_park_temp)); init_car_park(cp); /*ʵÌ廯ͣ³µ³¡£¬µ¹³µ³¡£¬±ãµÀ*/ init_car_park_back(cpb); init_car_park_temp(cpt); printf("\nA=³µÁ¾µ½´ï L=³µÁ¾À뿪 X=³µ³¡ÐÅÏ¢\n" ); car=(car_info *)malloc(sizeof(car_info)); do { printf("input the 'A' or 'L' or 'X' :" ); /*ÊäÈë´ý²Ù×÷µÄÃüÁî*/ scanf("%s",&ch); e=notfull_car_park(cp); /*Åжϳµ³¡ÊÇ·ñΪ¿Õ*/ switch(ch) /*ÅжÏÒªÊäÈëµÄÃüÁî*/ { case 'A': if(e==1) /*³µ³¡²»Âú£¬½øÈë³µÁ¾*/ { printf("input the car_number:" ); /*ÊäÈë³µÁ¾µÄ»ù±¾ÐÅÏ¢*/ scanf("%s",&car->car_number); printf("input the arrivetime:" ); scanf("%d",&(*car).arrivetime.hour); scanf("%d",&(*car).arrivetime.minute); enter_car_park(cp,car); /*½øÈë³µ³¡*/ printf("the car is in the car_park,the place is %d\n",cp->number); } else /*Èô³µ³¡Âú£¬½øÈë±ãµÀ*/ { enter_car_park_temp(cpt,car); printf("input the car_number:" ); scanf("%c",&car->car_number); printf("the car is in the car_park_temp,the place of temp is %d\n",cpt->number); } break; case 'L': /*À뿪ͣ³µ³¡*/ printf("input the car_number:" ); /*ÊäÈëÒªÀ뿪³µÁ¾µÄºÅÂëÒÔ¼°À뿪ʱ¼ä*/ scanf("%s",&car->car_number); printf("input the leavetime of the car:" ); scanf("%d",&(*car).leavetime.hour); scanf("%d",&(*car).leavetime.minute); leave_car_park(cp,car,cpb); /*Ö´ÐÐÀ뿪³µ³¡*/ i=(*car).leavetime.hour; /*Áî±ãµÀÀï³µÁ¾½øÈë³µ³¡µÄʱ¼äºÍ³µ³¡ÀïÃæµÄ³µÀ뿪µÄʱ¼äÏàµÈ*/ n=notempty_car_park_temp(cpt); /*ÅжϱãµÀÊÇ·ñ²»¿Õ*/ if(n==1) printf("The car %s",cpt->head->next->data->car_number); /*¼Çס±ãµÀÀïµÚÒ»Á¾³µµÄºÅÂë*/ leave_car_park_temp(cpt,car,cp); /*À뿪±ãµÀ£¬½øÈëÍ£³µ³¡*/ printf(" is enter the car_park,arrivetime is %d ,the place of carpark is %d\n",i,cp->number); break; case 'X': /*²é¿´³µ³¡ÒÔ¼°±ãµÀÀïµÄ³µÁ¾ÐÅÏ¢*/ printf("\nThere are %d cars in car park!\nFolowing is the carnumber in the car park:\n ",cp->number); for(i=1;i<=cp->number;i++) /*×öÑ»·£¬ÒÀ´ÎÊä³öÍ£³µ³¡Àï³µÁ¾µÄÐÅÏ¢*/ printf("%s,",(cp->north++)->car_number); cp->north=cp->north-cp->number; cpt2->head=cpt->head->next; /*ÉèÒ»¸öÐéÄâÖ¸ÕëʹÆäÖ¸ÏòÍ·½áµãµÄÏÂÒ»¸öλÖÃ*/ if(cpt->number==0) /*±ãµÀÀïûÓгµµÄÇé¿ö*/ printf("\nThere is no cars in temp!" ); else { printf("There are %d cars in car temp!\n Folowing is the carnumber in the car temp:\n ",cpt->number ) ; for(i=1;i<=cpt->number;i++) /*×öÒ»¸öÑ»·£¬Êä³ö±ãµÀÀï³µÁ¾µÄÐÅÏ¢*/ { printf("%d ",cpt2->head->next->data->car_number ) ; /* Êä³ö³µÁ¾µÄºÅÂë*/ cpt2->head=cpt2->head->next; } } break; default: printf("ERROR please input again\n" ) ; break; } } while(ch!='0'); } ûÓÐʲôÎÊÌâ,Êýѧרҵ×îºÃҲѧϳÌÐòÉè¼Æ·½Ãæ,ÒÔºóÕÒ¹¤×÷Ó¦¸ÃºÜÓÐÓô¦µÄ,ÎÒÒ²ÊÇÊýѧרҵµÄ. [ Last edited by jjdg on 2011-12-20 at 01:59 ] |
2Â¥2011-12-19 18:01:30
ÓÀÔ¶µÄ´ð°¸
Òø³æ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 657.1
- ºì»¨: 1
- Ìû×Ó: 90
- ÔÚÏß: 20.9Сʱ
- ³æºÅ: 1062274
- ×¢²á: 2010-07-22
- רҵ: ¸ÅÂÊÂÛÓëËæ»ú·ÖÎö
3Â¥2011-12-20 10:30:02














;
»Ø¸´´ËÂ¥