⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.cpp

📁 1、采用(1)盲目搜索(2)启发式搜索对凯撒密文进行自动解密。 2、对替代法加密的程序进行解密(未完成
💻 CPP
字号:
// List.cpp : implementation file
//

#include "stdafx.h"
#include "AI.h"
#include "List.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// List
List::~List()
{
	Node *next;
	while(first){
		next=first->next;
		delete first;
		first=next;
	}
}


BEGIN_MESSAGE_MAP(List, CWnd)
	//{{AFX_MSG_MAP(List)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// List message handlers
int List::Length() const
{
	Node *current=first;
	int len=0;
	while(current){
		len++;
		current=current->next;
	}
	return len;
}

int List::Locate(const CString& x) const
{
	Node *current=first;
	int index=1;
	while(current && current->data!=x){
		current=current->next;
		index++;
	}
	if(current) return index;
	return 0;
}


void List::Insert(const CString& x)
{
	Node *y=new Node;
	y->data=x;
	if(!Empty()){
		y->next=first;
		first=y;
	}
	else
		first=y;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -