資源簡介
列車時刻表管理C語言源代碼,功能不是很多,不過程序出錯率比較低,

代碼片段和文件信息
/*================================================================*\
|******************************************************************|
|*?????????????Train‘s?Time?List?Manage(列車時刻表管理)????********|
|**????????????????????????????????????????????????????????????****|
|****?????????????????????????????By?Snowing.NK@Frozenworld??????**|
|********?????????From:?2007.07.09????????????Date:?2007.07.11????*|
|******************************************************************|
\*================================================================*/
/*================================================================*\
|******************************************************************|
|**??????????????????????????????????????????????????????????????**|
|*???????請使用命令提示符(CMD.exe9X為command.com)運行本程序??????*|
|**??????????????????????????????????????????????????????????????**|
|******************************************************************|
\*================================================================*/
/******************************************************************\
|***************************code_start*****************************|
\******************************************************************/
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*\
\*++++++++++++++++++++++include+start++++++++++++++++++++++++++++*/
#include “math.h“
#include “stdio.h“
#include “conio.h“
#include “string.h“
#include “malloc.h“
//#include “windows.h“//not?use
/*+++++++++++++++++++++++include+end+++++++++++++++++++++++++++++*\
\*+++++++++++++++++++++++define+start++++++++++++++++++++++++++++*/
//constant‘s?define(常量的定義)
#define MaxLen 20 //the?max?of?string
#define lenid 10 //the?max?of?train‘s?coach?number‘s?string?
#define lentm 12 //the?max?of?time‘s?string
//time?type
typedef?struct{
int hour; //hour
int minute; //minute
}Times;
//data?saved?type
typedef?struct{
char ID[lenid]; //train‘s?coach?number
Times lvtime; //leave?time
Times avtime; //arrive?time
char start[MaxLen]; //start?station
char end[MaxLen]; //end?station
}datatype;
//creat?a?link?List
typedef?struct?linkList{
datatype *train; //train?infomation
linkList *next; //next?point
}linkList;
/*+++++++++++++++++++++++define+end++++++++++++++++++++++++++++++*\
\*+++++++++++++++++++++Function+start++++++++++++++++++++++++++++*/
//creat?a?linklist
linkList*?CrtList()
{
linkList* L;
L=(linkList?*)malloc(sizeof(linkList));
L->next=NULL;
return?L;
}
//get?the?lenth?of?the?list
int?LenList(linkList?*L)
{
int n=0;
while(L->next!=NULL)
{
L=L->next;
n++;
}
return?n;
}
//insert?a?data?into?the?list
int?InsList(linkList*?Ldatatype?*Item)
{
int i=0;
linkList *temp*H=NULL;
datatype *tmp;
temp=CrtList();
tmp=(datatype*)malloc(sizeof(datatype));
//to?memory
strcpy(tmp->IDItem->ID);
tmp->avtime=Item->avtime;
tmp->lvtime
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.CA....???????204??2007-07-12?10:33??TrainList\Debug\List.dat
????.CA....????229464??2007-07-12?09:50??TrainList\Debug\TrainList.exe
????.CA....????306100??2007-07-12?09:50??TrainList\Debug\TrainList.ilk
????.CA....?????63683??2007-07-12?09:50??TrainList\Debug\TrainList.obj
????.CA....????230552??2007-07-12?09:33??TrainList\Debug\TrainList.pch
????.CA....????549888??2007-07-12?09:50??TrainList\Debug\TrainList.pdb
????.CA....????156672??2007-07-12?09:50??TrainList\Debug\vc60.idb
????.CA....?????77824??2007-07-12?09:50??TrainList\Debug\vc60.pdb
?????文件????????136??2007-07-11?10:24??TrainList\List.dat
????.CA....?????29805??2007-07-12?13:38??TrainList\TrainList.cpp
????.CA....??????4007??2007-07-09?22:51??TrainList\TrainList.dsp
?????文件????????543??2007-07-09?17:10??TrainList\TrainList.dsw
????.CA....?????58368??2007-07-12?10:41??TrainList\TrainList.ncb
????.CA....?????49664??2007-07-12?10:41??TrainList\TrainList.opt
????.CA....??????1318??2007-07-12?09:50??TrainList\TrainList.plg
????.C.D...?????????0??2007-07-11?17:25??TrainList\Debug
????.C.D...?????????0??2007-07-13?08:02??TrainList
-----------?---------??----------?-----??----
??????????????1758228????????????????????17
- 上一篇:單片空間后方交會,求外方位元素、評定精度(MFC寫的)
- 下一篇:C++屏幕錄制
評論
共有 條評論