资源简介
列车时刻表管理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++屏幕录制
相关资源
- 操作系统c语言模拟文件管理系统844
- C语言开发实战宝典
- C++中头文件与源文件的作用详解
- C语言代码高亮html输出工具
- 猜数字游戏 c语言代码
- C语言课程设计
- 数字电位器C语言程序
- CCS FFT c语言算法
- 使用C语言编写的病房管理系统
- 通信过程中的RS编译码程序(c语言)
- 计算机二级C语言上机填空,改错,编
- 用回溯法解决八皇后问题C语言实现
- 简易教务管理系统c语言开发文档
- 操作系统课设 读写者问题 c语言实现
- 小波变换算法 c语言版
- C流程图生成器,用C语言代码 生成C语
- 3des加密算法C语言实现
- 简单的C语言点对点聊天程序
- 单片机c语言源程序(51定时器 八个按
- 个人日常财务管理系统(C语言)
- c语言电子商务系统
- 小甲鱼C语言课件 源代码
- 将图片转换为C语言数组的程序
- C语言实现的一个内存泄漏检测程序
- DES加密算法C语言实现
- LINUX下命令行界面的C语言细胞游戏
- 用单片机控制蜂鸣器播放旋律程序(
- 学校超市选址问题(数据结构C语言版
- 电子时钟 有C语言程序,PROTEUS仿真图
- 尚观培训linux许巍老师关于c语言的课
评论
共有 条评论