?? cd4_2u.cpp
字號:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <time.h> //時間相關函數
#include "cd4_2u.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
class Node //定義結點類
{
friend class List; //以friend的方式共享資源
public: //公有變量,函數,程序定義
Node(String s):name(s),link(NULL){} //結點產生時的內容設置
Node *link; //結點鏈結的指針
private: //私有變量,函數,程序定義
String name; //定義字符串型的私有變量name
};
class List //定義鏈結類
{
private:
Node* first; //設定首結點的鏈結
Node* last; //設定尾結點的鏈結
public: //通常類的使用都是在此下方,用函數方式表示
void istf(String s) //鏈表前端加入的函數
{
Node* newnode=new Node(s); //C++的新增對象的方法
newnode->link=first;
first=newnode;
}
void istb(String s) //鏈表后端加入的函數
{
Node* newnode=new Node(s);
if(empty())
first=newnode;
else
last->link=newnode;
last=newnode;
}
void dplist(); //定義鏈表顯示函數
bool empty(){return first==NULL;} //確認鏈表是否為空
void clear() //鏈表的清除函數
{
Node* temp=first;
first=first->link;
delete temp; //C++ 將對象刪除,釋放空間的方法
}
};
List H,b; //設置前(H)后(b)兩鏈表
String str;
int i,t,t1;
static int r=1,con1;
time_t tim; //定義tim為時間類型
tm *dat; //定義dat為結構類型
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::endClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
sg->Cells[0][0]=" 座 次";
sg->Cells[1][0]="
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -