偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

巧妙的進(jìn)行VC++6.0代碼編制

開(kāi)發(fā) 后端
對(duì)于VC++6.0代碼正確的編寫(xiě)非常不易,但前提是要深入理解到底什么是VC++6.0代碼,及他是怎么運(yùn)作的,這樣就給許多用戶帶來(lái)了便捷。

下面詳細(xì)說(shuō)明介紹VC++6.0代碼的編制問(wèn)題,對(duì)原來(lái)寫(xiě)過(guò)的代碼做了一點(diǎn)修改,些內(nèi)容都是一些門戶網(wǎng)站和技術(shù)論壇找到的,中間可能有不少錯(cuò)誤是我沒(méi)有挑出的,歡迎大家指正。

VC++6.0代碼如下:

  1. public:  
  2.  
  3.  
  4.  void addcity(int city);  
  5.  int tabu[iCityCount];  
  6.  void Clear();  
  7.  void UpdateResult();  
  8.  double m_dLength;  
  9.  double m_dShortest;  
  10.  void move();  
  11.  ant();  
  12.  void move2last();  
  13.  
  14.  
  15. };  
  16. void ant::move2last()  
  17. {  
  18.  
  19.  
  20.  int i;  
  21.  for(i=0;i《iCityCount;i++)  
  22.  
  23.   if (AllowedCity[i]==1)  
  24.   {  
  25.    addcity(i);  
  26.    break;  
  27.   }  
  28.  
  29.  
  30. }  
  31.  
  32.  
  33. void ant::Clear()  
  34. {  
  35.  m_dLength=0;  
  36.  int i;  
  37.  for(i=0; i〈iCityCount;i++)  
  38.  
  39.   prob[i]=0;  
  40.   AllowedCity[i]=1;  
  41.  }  
  42.  i=tabu[iCityCount-1];  
  43.  m_iCityCount=0;  
  44.  addcity(i);  
  45. }  
  46. ant::ant()  
  47. {  
  48.  m_dLength=m_dShortest=0;  
  49.  m_iCityCount=0;  
  50.  int i;  
  51.  for(i=0;i〈iCityCount;i++)  
  52.  
  53.   AllowedCity[i]=1;  
  54.   prob[i]=0;  
  55.  }  
  56. }  
  57. void ant::addcity(int city)  
  58. {  
  59.  //add city to tabu;  
  60.  tabu[m_iCityCount]=city;  
  61.  m_iCityCount++;  
  62.  AllowedCity[city]=0;  
  63. }  
  64. int ant::ChooseNextCity()  
  65. {  
  66.  //Update the probability of path selection  
  67.  //select a path from tabu[m_iCityCount-1] to next  
  68.  
  69.  
  70.  int i;  
  71.  int j=10000;  
  72.  double temp=0;  
  73.  int curCity=tabu[m_iCityCount-1];  
  74.  for (i=0;i〈iCityCount;i++)  
  75.  
  76.   if((AllowedCity[i]==1))   
  77.   {  
  78.    temp+=pow((1.0/Map.distance[curCity][i]),beta)*pow((Map.m_dTrial[curCity][i]),alpha);  
  79.   }  
  80.  } 

以上就是VC++6.0代碼的舉例說(shuō)明,可以修改循環(huán)次數(shù)和其他參數(shù)。以得到更好的解。使用TSP數(shù)據(jù)的時(shí)候,將前面的一些字符串信息刪除,只留下坐標(biāo)數(shù)據(jù)。

【編輯推薦】

  1. 如何正確編寫(xiě)C++項(xiàng)目開(kāi)發(fā)編寫(xiě)項(xiàng)目計(jì)劃書(shū)
  2. 對(duì)C++庫(kù)函數(shù)進(jìn)行學(xué)習(xí)探索總結(jié)筆記
  3. 深度演示C++語(yǔ)言的種種高安全性
  4. 詳細(xì)介紹如何準(zhǔn)確無(wú)誤的編寫(xiě)C++語(yǔ)言
  5. 深度演示C++語(yǔ)言的種種高安全性
責(zé)任編輯:chenqingxiang 來(lái)源: NET130
相關(guān)推薦

2010-01-26 16:47:47

VC++6.0

2010-01-22 18:06:24

C++代碼

2009-12-10 16:50:58

Visual Stud

2010-01-26 09:40:23

C++代碼

2009-12-08 16:22:06

WCF代碼

2009-12-14 10:54:57

VS 2008代碼

2009-12-29 11:03:28

ADO代碼

2010-01-11 15:36:08

C++代碼

2021-12-30 11:30:13

人工智能機(jī)器學(xué)習(xí)技術(shù)

2010-01-28 15:56:38

VC++ 6.0編譯

2011-06-10 14:33:38

Qt VC.NET

2020-06-05 14:48:11

零代碼低代碼開(kāi)發(fā)

2015-07-21 15:35:47

代碼總結(jié)源碼

2009-12-18 10:24:28

VS 2010代碼

2009-03-04 09:52:35

代碼契約組件接口

2009-12-14 16:04:23

MyEclipse 6

2021-11-04 08:06:47

代碼編排平臺(tái)

2009-12-17 14:09:03

VS2005代碼

2020-06-05 14:43:25

零代碼平臺(tái)企業(yè)軟件代碼

2010-01-12 16:42:59

C++編譯器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)