📄 pattern.cpp
字号:
// Pattern.cpp: implementation of the CPattern class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "IsoData.h"
#include "Pattern.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPattern::CPattern(int n)
{
N = n;
int i;
struct PatternElement * ptemp1,* ptemp2;
ptemp1 = new struct PatternElement;
pPatternElementHead = ptemp1;
ptemp2 = ptemp1;
for (i=1;i<=N;i++)
{
ptemp2->next = ptemp1;
ptemp2 = ptemp1;
if (i!=N)
ptemp1 = new struct PatternElement;
else
ptemp1 = NULL;
}
}
CPattern::~CPattern()
{
int i;
int j;
struct PatternElement * ptemp1;
ptemp1 = pPatternElementHead;
for (j=1;j<=N-1;j++)
{
for (i=1;i<=N-j;i++)
{
ptemp1 = ptemp1->next;
}
delete ptemp1;
}
delete pPatternElementHead;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -