拉斯维加斯算法解决整数分割(一次)
// 整数分割.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include "stdafx.h"
#include"iostream"
#include<math.h>
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long maxshort=65535L;
const unsigned long multiplier=1194211693L;
const unsigned long adder=12345L;
class RandomNumber{
private:
//当前种子
unsigned long randSeed;
public:
//构造函数
RandomNumber(unsigned long s=0);
unsigned short Random(unsigned long n);
double fRandom();
};
RandomNumber::RandomNumber(unsigned long s)
{
if(s==0)
randSeed=time(0);
else
randSeed=s;
}
double RandomNumbe