摘要: 原理很简单#include using namespace std;int x[20]; //解向量int sum; //可行方案个数int n;//在第t列是否可放置bool place(int t){ int i; for(i=1; i n){ sum++; for(i=1; i> n){ ... 阅读全文
posted @ 2014-02-12 17:32 海滨银枪小霸王 阅读(129) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;// 获得0-1之间的随机数double get_random_num (){ return (double)rand () / RAND_MAX ;}// 用随机投点法计算 PIdouble dar... 阅读全文
posted @ 2014-02-12 15:29 海滨银枪小霸王 阅读(1529) 评论(0) 推荐(0) 编辑