亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cpp1.cpp

?? TSP貨郎擔過河問題
?? CPP
字號:
#include <iostream>
#include<string>
#include<fstream>
#include <windows.h>

using namespace std;

static string SymbolTable[100];
static string IntRealTable[100];
static string StringTable[100];

//==================Table1()============================
//=======catch the table1 word of SIC
//=======then compare which position that the word is
//======================================================
int Table1(string tmp_word)
{
	int count=1;  // record the word position
	string word;  // register the word of SIC one by one
	ifstream file;
	file.open("table1.txt",ios::in);
	if(!file)
	{
		//cout<<"no table1.txt file"<<endl;
	}
	else
	{
		//cout<<"read table1.txt in"<<endl;
		while(!file.eof())
		{
			int compare_value;  //if compare_value is 0,it means the two words the same
			file>>word;
			compare_value=tmp_word.compare(word);
			if(compare_value==0)
				return count;
			count++;
		}
	}
	return 0;
	file.close();
}


//==================Table2()============================
//=======catch the table2 word of SIC
//=======then compare which position that the word is
//======================================================
int Table2(string tmp_word)
{
	int count=1;  // record the word position
	string word;  // register the word of SIC one by one
	ifstream file;
	file.open("table2.txt",ios::in);
	if(!file)
	{
		//cout<<"no table2.txt file"<<endl;
	}
	else
	{
		//cout<<"read table2.txt in"<<endl;
		while(!file.eof())
		{
			int compare_value;  //if compare_value is 0,it means the two words the same
			file>>word;
			compare_value=tmp_word.compare(word);
			if(compare_value==0)
				return count;
			count++;
		}
	}
	return 0;
	file.close();
}


//==================Table3()============================
//=======catch the table3 word of SIC
//=======then compare which position that the word is
//======================================================
int Table3(string tmp_word)
{
	int count=1;  // record the word position
	string word;  // register the word of SIC one by one
	ifstream file;
	file.open("table3.txt",ios::in);
	if(!file)
	{
		//cout<<"no table3.txt file"<<endl;
	}
	else
	{
		//cout<<"read table3.txt in"<<endl;
		while(!file.eof())
		{
			int compare_value;  //if compare_value is 0,it means the two words the same
			file>>word;
			compare_value=tmp_word.compare(word);
			if(compare_value==0)
				return count;
			count++;
		}
	}
	return 0;
	file.close();
}


//==================Table4()============================
//=======catch the table4 word of SIC
//=======then compare which position that the word is
//======================================================
int Table4(string tmp_word)
{
	int count=1;  // record the word position
	string word;  // register the word of SIC one by one
	ifstream file;
	file.open("table4.txt",ios::in);
	if(!file)
	{
		//cout<<"no table4.txt file"<<endl;
	}
	else
	{
		//cout<<"read table4.txt in"<<endl;
		while(!file.eof())
		{
			int compare_value;  //if compare_value is 0,it means the two words the same
			file>>word;
			compare_value=tmp_word.compare(word);
			if(compare_value==0)
				return count;
			count++;
		}
	}
	return 0;
	file.close();
}

/*
int Table5(string tmp_word)
{
	int count=0;
	string word[100];
	while(!word[count].empty())
	{
		int compare_value;
		compare_value=tmp_word.compare(word[count]);
		if(compare_value==0)
			return count+1;
		count++;
	}
	word[count]=tmp_word;
	return ;
}*/


//==================Symbol Table======================
//======== Create a Symbol Table with hash function
//======== and record the position information
//====================================================
int Table5(string tmp_word)
{
	int count=0;
	for(int i=0;i<tmp_word.length();i++)
	{
		count=count+tmp_word.at(i);
	}
	//cout<<count<<endl;
	count=count%100;
	//compare_value=tmp_word.compare(SymbolTable[count]);
	//cout<<compare_value<<endl;
	while(!SymbolTable[count].empty())
	{
		int compare_value;
		compare_value=tmp_word.compare(SymbolTable[count]);
		//cout<<compare_value;
		if(compare_value!=0)
			count++;
		else
			break;
	}
	SymbolTable[count].assign(tmp_word);
	return count;
}


//==================Integer/Real Table======================
//======== Create a Integer/Real Table with hash function
//======== and record the position information
//==========================================================
int Table6(string tmp_word)
{
	int count=0;
	for(int i=0;i<tmp_word.length();i++)
	{
		count=count+tmp_word.at(i);
	}
	count=count%100;
	while(!IntRealTable[count].empty())
	{
		int compare_value;
		compare_value=tmp_word.compare(IntRealTable[count]);
		if(compare_value!=0)
			count++;
		else
			break;
	}
	IntRealTable[count].assign(tmp_word);
	return count;
}


//==================String Table======================
//======== Create a String Table with hash function
//======== and record the position information
//==========================================================
int Table7(string tmp_word)
{
	int count=0;
	for(int i=0;i<tmp_word.length();i++)
	{
		count=count+tmp_word.at(i);
	}
	count=count%100;
	while(!StringTable[count].empty())
	{
		int compare_value;
		compare_value=tmp_word.compare(StringTable[count]);
		if(compare_value!=0)
			count++;
		else
			break;
	}
	StringTable[count].assign(tmp_word);
	return count;
}

//==============get()=========================
//========= Make the useless char to be NULL
//========= and record in a
//============================================
string get(char tmp[])
{
	int ptr=0;
	string a;
	a.erase();
	while(tmp[ptr]!=NULL)
	{
		a=a+tmp[ptr];
		ptr++;
	}
	return a;
}


//============ReadFile()===========================
//===== 1st. Read the gived file in
//===== 2ed. Judge the word and table one by one
//===== 3rd. output the file
//=================================================
void ReadFile()
{
	char word[50];
	for(int i=0;i<50;i++)
		word[i]=NULL;
	string string_tmp;
	char filename[50];
	ifstream file;
	cout<<"Enter a file name"<<endl;
	cin>>filename;
	file.open(filename,ios::in);

	fstream cleanfile,outputfile;

	//===clean the file===
	cleanfile.open("9027110.txt",ios::out | ios::trunc);
	cleanfile.close();
	
	//===write the file===
	outputfile.open("9027110.txt",ios::out | ios::app);
    //cout << "write file OK" << endl;

	if(!file)
	{
		cout<<"no this file"<<endl;
	}
	else
	{
		cout<<"read file in";
		for(int x=0;x<5;x++)
		{
			Sleep(300);
			cout << "."; 
		}
		cout<<"OK"<<endl;
		while(!file.eof())
		{
			
			int length=0;
			//string_tmp.erase();
			file.getline(word,50);
			//string_tmp=word;
			//cout<<endl;
			//cout<<word<<endl;
			outputfile<<endl;
			outputfile<<word<<endl;
			
			//cout<<string_tmp<<endl;

			while(length<=50 && word[length]!=NULL)
			{
				//Maybe Space or Tab at the first
				if(word[length]==0 || word[length]==32)
					length++;
				else
				{
					// Judge Table1 or Table2 or Table3 or Table5
					if((word[length]>=65 && word[length]<=90) || (word[length]>=97 && word[length]<=122))
					{
						int length_tmp=0;
						char short_word[50];
						for(int i=0;i<50;i++)
							short_word[i]=NULL;
						while((word[length]>=65 && word[length]<=90) || (word[length]>=97 && word[length]<=122))
						{
							short_word[length_tmp]=word[length];
							length_tmp++;
							length++;
						}
						// if not the table , then return zero
						if(Table1(short_word)==0)
						{
							if(Table2(short_word)==0)
							{
								if(Table3(short_word)==0)
								{
									//cout<<"("<<5<<" , "<<Table5(get(short_word))<<")";
									outputfile<<"("<<5<<" , "<<Table5(get(short_word))<<")";
								}
								else
								{
									//cout<<"("<<3<<" , "<<Table3(get(short_word))<<")";
									outputfile<<"("<<3<<" , "<<Table3(get(short_word))<<")";
								}
							}
							else
							{
								//cout<<"("<<2<<" , "<<Table2(get(short_word))<<")";
								outputfile<<"("<<2<<" , "<<Table2(get(short_word))<<")";
							}

						}
						else
						{
							//cout<<"("<<1<<" , "<<Table1(get(short_word))<<")";
							outputfile<<"("<<1<<" , "<<Table1(get(short_word))<<")";
						}
					}
					else
					{
						// Judge Table4 or Table 6 or Table7
						int length_tmp3=0;
						char short_word[50];
						for(int i=0;i<50;i++)
							short_word[i]=NULL;
						if(word[length]>=48 && word[length]<=57)
						{
							while(word[length]>=48 && word[length]<=57)
							{
								short_word[length_tmp3]=word[length];
								length_tmp3++;
								length++;
							}
							//cout<<"("<<6<<" , "<<Table6(get(short_word))<<")";
							outputfile<<"("<<6<<" , "<<Table6(get(short_word))<<")";
						}
						else
						{
							//cout<<"("<<4<<" , "<<Table4(get(short_word))<<")";
							//cout<<word[length]<<endl;
							string table4_tmp;
							table4_tmp=word[length];
							outputfile<<"("<<4<<" , "<<Table4(table4_tmp)<<")";
							length++;
							// The table7 is String_table,so it must be between two (')
							if(word[length-1]==39)
							{
								int length_tmp2=0,flag=0;
								char short_word2[50];
								for(int i=0;i<50;i++)
									short_word2[i]=NULL;
								while(flag==0)
								{
									if(word[length]!=39)
									{
										// record string
										short_word2[length_tmp2]=word[length];
										length_tmp2++;
										length++;
									}
									else
										flag=1;
								}
								//cout<<"("<<7<<" , "<<Table7(get(short_word2))<<")";
								//cout<<"("<<4<<" , "<<Table4(get(short_word))<<")";
								outputfile<<"("<<7<<" , "<<Table7(get(short_word2))<<")";
								string table4_tmp2;
								table4_tmp2=word[length];
								outputfile<<"("<<4<<" , "<<Table4(table4_tmp2)<<")";
								length++;
							}
						}
					}
				}
			}
		}
	}
	cout << "write file out";
	for(int x=0;x<5;x++)
	{
		Sleep(300);
		cout << "."; 
	}
	cout<<"OK" << endl;
	file.close();
}

void main()
{
	ReadFile();
	//string a("'");
	//cout<<Table4(a)<<endl;

	/*
	char a={'a'};
	string b;
	b.erase();
	b=b+a;
	cout<<b<<endl;
	cout<<b.length()<<endl;*/
	/*char a[2];
	a[0]=;
	string b;
	b.erase();
	b=a;
	cout<<a<<endl;
	cout<<b<<endl;*/
	/*char *b;
	b="AB";
	//cout<<b.at(1)<<endl;
	int c;
	c=atoi(b);
	cout<<c<<endl;*/
	//string b("Hello,World");
	//string c("check it out");
	//string d("Hello,Worle");
	//Table5(b);
	//Table5(c);
	//cout<<Table7(b)<<endl;
	//cout<<Table7(c)<<endl;
	//cout<<Table7(d)<<endl;
	//cout<<SymbolTable[31]<<endl;
	//cout<<SymbolTable[32]<<endl;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产高清久久久久| 欧美日韩一区二区电影| 欧美亚洲日本国产| 久久综合色8888| 天堂av在线一区| 91亚洲精华国产精华精华液| 精品国产乱码久久久久久闺蜜| 一区二区成人在线| 成人午夜免费av| 亚洲精品一区二区三区99| 亚洲午夜激情网站| 色视频一区二区| 欧美三级电影在线看| 日韩欧美激情一区| 一区二区三区日韩欧美精品| 国产福利91精品| 欧美一卡2卡3卡4卡| 五月天婷婷综合| 欧美性生活一区| 一区二区三区小说| eeuss影院一区二区三区| 久久久91精品国产一区二区三区| 免费观看91视频大全| 欧美日韩国产精品自在自线| 亚洲国产一区在线观看| 欧美调教femdomvk| 黑人巨大精品欧美一区| 中文字幕一区二区三区视频| 国产精品一区在线观看你懂的| 日本久久精品电影| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产成人午夜精品影院观看视频| www日韩大片| 国产一区二区三区视频在线播放| 91精品国产麻豆国产自产在线| 日韩电影在线免费观看| 91麻豆精品国产91久久久| 日韩中文字幕区一区有砖一区| 欧美二区在线观看| 日本成人在线看| 久久女同精品一区二区| 国产成人精品影院| 国产精品的网站| 在线免费观看日韩欧美| 亚洲国产cao| 欧美一级欧美一级在线播放| 九九九精品视频| 国产丝袜欧美中文另类| 99在线精品免费| 国产精品成人一区二区三区夜夜夜| 国产高清精品网站| 亚洲欧洲成人精品av97| 色8久久精品久久久久久蜜| 五月天精品一区二区三区| 欧美成人精精品一区二区频| 国产xxx精品视频大全| 亚洲欧洲日韩综合一区二区| 欧美人伦禁忌dvd放荡欲情| 蜜桃一区二区三区在线| 国产精品免费丝袜| 欧美精品一二三四| 激情综合一区二区三区| 成人免费视频在线观看| 欧美日韩国产另类不卡| 在线观看视频一区二区 | 国产福利视频一区二区三区| 国产精品传媒在线| 91麻豆精品国产91久久久久| 成人激情校园春色| 日韩精品久久理论片| 国产精品免费aⅴ片在线观看| 日本高清无吗v一区| 国产综合色视频| 亚洲图片欧美色图| 国产亚洲精品aa| 欧美午夜一区二区| 高清不卡一区二区| 日本不卡一二三区黄网| 亚洲美女电影在线| 久久毛片高清国产| 欧美日韩高清一区二区不卡| 粉嫩aⅴ一区二区三区四区五区| 亚洲大尺度视频在线观看| 久久久噜噜噜久久中文字幕色伊伊| 欧美亚男人的天堂| 国产iv一区二区三区| 免费欧美日韩国产三级电影| 亚洲激情中文1区| 欧美国产亚洲另类动漫| 欧美一区三区四区| 色成人在线视频| 波多野洁衣一区| 国产一区二区三区观看| 日韩中文字幕91| 亚洲精品你懂的| 亚洲特级片在线| 久久影院午夜论| 日韩欧美123| 在线播放中文字幕一区| 欧美三片在线视频观看| 色噜噜狠狠一区二区三区果冻| 成人精品国产一区二区4080| 国内精品久久久久影院薰衣草| 日本中文在线一区| 午夜av电影一区| 亚洲午夜精品一区二区三区他趣| 国产精品久久久久久久久免费丝袜| 欧美精品一区二区三区很污很色的| 欧美老肥妇做.爰bbww| 欧美伊人精品成人久久综合97| 99久久伊人精品| 一本一本大道香蕉久在线精品| 成人av资源站| 91丨国产丨九色丨pron| av网站一区二区三区| jizz一区二区| www.欧美亚洲| 色天使久久综合网天天| 在线国产电影不卡| 欧美亚洲一区三区| 欧美日韩激情在线| 日韩亚洲电影在线| 欧美v亚洲v综合ⅴ国产v| 久久久亚洲精品一区二区三区 | 欧美日韩国产小视频| 欧美三电影在线| 欧美一区午夜精品| 久久久99精品免费观看不卡| 国产精品久久久久久久久快鸭| 亚洲色图欧美偷拍| 亚洲小说欧美激情另类| 性做久久久久久免费观看欧美| 天堂蜜桃一区二区三区| 麻豆视频一区二区| 国产精品亚洲а∨天堂免在线| 成人少妇影院yyyy| 色婷婷综合五月| 欧美一区中文字幕| 久久亚洲一级片| 综合亚洲深深色噜噜狠狠网站| 亚洲一二三区不卡| 国产真实乱对白精彩久久| 97久久超碰国产精品| 在线不卡中文字幕| 中文字幕高清一区| 午夜精品久久一牛影视| 国产在线播放一区三区四| 不卡欧美aaaaa| 91精品国产日韩91久久久久久| 日本一区免费视频| 调教+趴+乳夹+国产+精品| 国产福利一区二区三区视频在线| 色嗨嗨av一区二区三区| 久久影视一区二区| 亚洲综合色噜噜狠狠| 国产精品中文欧美| 欧美日韩一区成人| 国产精品色婷婷| 美女看a上一区| 色琪琪一区二区三区亚洲区| 精品日韩在线观看| 亚洲免费电影在线| 国产精品18久久久久久vr| 欧美少妇bbb| 国产精品久久三| 国产一区二区在线观看免费| 欧美在线观看一区二区| 国产精品无人区| 精品一二三四在线| 欧美日韩国产综合草草| 国产精品高潮呻吟| 激情文学综合丁香| 91官网在线免费观看| 中文字幕av免费专区久久| 日本欧美一区二区在线观看| 99国产精品99久久久久久| 久久综合久久综合亚洲| 视频一区国产视频| 色哦色哦哦色天天综合| 久久久久国产一区二区三区四区| 亚洲无人区一区| 在线区一区二视频| 亚洲欧美日韩中文播放 | 国内偷窥港台综合视频在线播放| 日本韩国一区二区三区视频| 中文字幕一区二区三区不卡在线| 国产一区二区三区免费观看| 日韩欧美国产综合| 日韩国产精品91| 91精品国产综合久久精品图片| 亚洲精品视频免费看| 色香蕉成人二区免费| 中文字幕亚洲电影| 99久久精品免费看| 中文字幕一区二区三区不卡| 成人精品免费看| 中文字幕在线观看一区二区| 99精品热视频| 一区二区成人在线视频| 色欧美88888久久久久久影院|