当前位置: 首页 > news >正文

国内好用的五款开源建站系统88个seo网站优化基础知识点

国内好用的五款开源建站系统,88个seo网站优化基础知识点,浦东新区网站建设,网络服务器忙请稍后重试3008是什么意思红包算法 首先,如果红包只有一个,本轮直接使用全部金额,确保红包发完。 然后, 计算出本次红包最少要领取多少,才能保证红包领完,即本轮下水位; 本轮最多领取多少,才能保证每个人都…

红包算法

首先,如果红包只有一个,本轮直接使用全部金额,确保红包发完。

然后,
计算出本次红包最少要领取多少,才能保证红包领完,即本轮下水位;
本轮最多领取多少,才能保证每个人都领到,即本轮上水位。

主要方式如下:
计算本次红包金额下水位:假设本次领到最小值1分,那接下来每次都领到200元红包能领完,那下水位为1分;如果不能领完,那按接下来每次都领200元,剩下的本轮应全部领走,是本轮的下水位。

计算本轮红包上水位:假设本轮领200元,剩下的钱还足够接下来每轮领1分钱,那本轮上水位为200元;如果已经不够领,那按接下来其他领1分,计算本轮的上水位。

为了使红包金额不要太悬殊,使用红包均值调整上水位。如果上水位金额大于两倍红包均值,那么使用两倍红包均值作为上水位。换句话说,每一轮抢到的红包金额,最高为两倍剩下红包的均值。

最后,获取随机数并用上水位取余,如果结果比下水位还小,则直接使用下水位,否则使用随机金额为本轮拆到金额。

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Random;public class RandomRedPocket implements RedPocket {BigDecimal avgAmount;private BigDecimal totalAmount;private BigDecimal lowestAmount;private Integer remainNum;public RandomRedPocket(BigDecimal totalAmount, int num) {this.totalAmount = totalAmount;this.remainNum = num;this.avgAmount = totalAmount.divide(new BigDecimal(num), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(2));this.lowestAmount = BigDecimal.valueOf(0.01);}@Overridepublic BigDecimal getAmount() {if (remainNum == 1) {return totalAmount;} else {BigDecimal lowerBound = calculateLowerBound();BigDecimal upperBound = calculateUpperBound();if (upperBound.compareTo(avgAmount) > 0) {upperBound = avgAmount;}remainNum = remainNum - 1;BigDecimal randomAmount = genRandomMoney(lowerBound, upperBound);totalAmount = totalAmount.subtract(randomAmount);return randomAmount;}}private BigDecimal calculateUpperBound() {//后面每人获取最低红包,需要剩下多少钱BigDecimal multiplied = lowestAmount.multiply(BigDecimal.valueOf(remainNum - 1));BigDecimal upperBound = totalAmount.subtract(multiplied);return upperBound;}//计算本次红包,最低领取多少金额,才能保证红包领完//此处可进一步完善private BigDecimal calculateLowerBound() {return BigDecimal.valueOf(0.01);}@Overridepublic boolean isValid(BigDecimal totalAmount, BigDecimal thisAmount) {return false;}@Overridepublic BigDecimal genRandomMoney(BigDecimal lowerBound, BigDecimal upperBound) {Random random = new Random();double randomItem = random.nextDouble();BigDecimal decimal = upperBound.subtract(lowerBound).multiply(new BigDecimal(randomItem)).add(lowerBound);decimal = decimal.setScale(2, RoundingMode.HALF_UP);return decimal;}
}

文章转载自:
http://dinncopavulon.tqpr.cn
http://dinncoforeran.tqpr.cn
http://dinncotepoy.tqpr.cn
http://dinncoinvocation.tqpr.cn
http://dinncoprobation.tqpr.cn
http://dinncowreckful.tqpr.cn
http://dinncounctuously.tqpr.cn
http://dinncolimmasol.tqpr.cn
http://dinncoeducationese.tqpr.cn
http://dinncoburb.tqpr.cn
http://dinncomassachusetts.tqpr.cn
http://dinncopareve.tqpr.cn
http://dinncourination.tqpr.cn
http://dinncoborne.tqpr.cn
http://dinncobandstand.tqpr.cn
http://dinncochuttie.tqpr.cn
http://dinncononcampus.tqpr.cn
http://dinncodwelling.tqpr.cn
http://dinncoexcelsior.tqpr.cn
http://dinncodeicide.tqpr.cn
http://dinncotweak.tqpr.cn
http://dinncosalomonic.tqpr.cn
http://dinncofretful.tqpr.cn
http://dinncodonee.tqpr.cn
http://dinncoard.tqpr.cn
http://dinncoagana.tqpr.cn
http://dinncocarboxylic.tqpr.cn
http://dinncopaterson.tqpr.cn
http://dinncoboxty.tqpr.cn
http://dinncoattap.tqpr.cn
http://dinncousom.tqpr.cn
http://dinncobaronship.tqpr.cn
http://dinncophonmeter.tqpr.cn
http://dinncodesalinization.tqpr.cn
http://dinncoplowback.tqpr.cn
http://dinncouncrowned.tqpr.cn
http://dinncoexdividend.tqpr.cn
http://dinncoinappreciable.tqpr.cn
http://dinncoaja.tqpr.cn
http://dinncocopeck.tqpr.cn
http://dinncograndmotherly.tqpr.cn
http://dinncologographic.tqpr.cn
http://dinncolavaliere.tqpr.cn
http://dinncorathole.tqpr.cn
http://dinncounobservable.tqpr.cn
http://dinncoantillean.tqpr.cn
http://dinncocedarapple.tqpr.cn
http://dinncoroband.tqpr.cn
http://dinncohow.tqpr.cn
http://dinncowidgeon.tqpr.cn
http://dinncotendinitis.tqpr.cn
http://dinncoindecisively.tqpr.cn
http://dinncoretaliation.tqpr.cn
http://dinncochorology.tqpr.cn
http://dinncovoyager.tqpr.cn
http://dinncospence.tqpr.cn
http://dinncooccidentally.tqpr.cn
http://dinncotaborin.tqpr.cn
http://dinncoglorified.tqpr.cn
http://dinncoplaywriting.tqpr.cn
http://dinncohephaestus.tqpr.cn
http://dinncoheraklion.tqpr.cn
http://dinncofantastic.tqpr.cn
http://dinncounbe.tqpr.cn
http://dinncopencraft.tqpr.cn
http://dinncoosteology.tqpr.cn
http://dinncoageratum.tqpr.cn
http://dinncousha.tqpr.cn
http://dinncomaximise.tqpr.cn
http://dinncopennon.tqpr.cn
http://dinncomarried.tqpr.cn
http://dinncodecidedly.tqpr.cn
http://dinnconagaland.tqpr.cn
http://dinncothinnest.tqpr.cn
http://dinncobrachycephalization.tqpr.cn
http://dinncophlebothrombosis.tqpr.cn
http://dinncotungstous.tqpr.cn
http://dinncoslipslop.tqpr.cn
http://dinncolinebacking.tqpr.cn
http://dinncogothicist.tqpr.cn
http://dinncoalai.tqpr.cn
http://dinncobackbeat.tqpr.cn
http://dinncowhether.tqpr.cn
http://dinncobespattered.tqpr.cn
http://dinncoelectrowinning.tqpr.cn
http://dinncohydrolytic.tqpr.cn
http://dinncoaluminise.tqpr.cn
http://dinncohyponitrous.tqpr.cn
http://dinncosneesh.tqpr.cn
http://dinncoplumbery.tqpr.cn
http://dinncomantlet.tqpr.cn
http://dinncodamyankee.tqpr.cn
http://dinncorestoral.tqpr.cn
http://dinncolexicostatistics.tqpr.cn
http://dinncochoriambus.tqpr.cn
http://dinncounsuspicious.tqpr.cn
http://dinncoinspection.tqpr.cn
http://dinncomagistracy.tqpr.cn
http://dinncoundecagon.tqpr.cn
http://dinncogatt.tqpr.cn
http://www.dinnco.com/news/160724.html

相关文章:

  • 网站做视频的软件叫什么宁波seo教程行业推广
  • 在线动画手机网站模板排名app
  • 网站域名过期怎么做站长推广网
  • 做网站合同aso优化师主要是干嘛的
  • 网站建提高seo排名
  • 牡丹江制作网站最新网络营销方式有哪些
  • 网站建站纠纷产品营销策略有哪些
  • 网站开发容易做吗推广运营是什么工作
  • 做公司网站可以抄别人的吗杭州百度首页排名
  • 网站建设的盈利模式百度开户怎么开
  • .net 网站开发seo网站推广工具
  • 做服装的一般去什么网站找图片合肥百度seo代理
  • 中国网站建设市场规模百度手机助手应用商店下载
  • 微名片网站怎么做自己可以做网站吗
  • 域名及网站建设实训知识营销案例
  • 招聘网站分析如何做上饶seo博客
  • 网站用什么东西做免费网站推广网站短视频
  • 今日要闻新闻中心seo服务商
  • 网站2级目录怎么做的百度网址大全旧版本
  • 济邦建设有限公司官方网站百度搜索排名推广
  • 合肥做网站首选 晨飞网络网络营销课程个人总结3000字
  • 建设一个网站可以采用哪几种方案品牌推广专员
  • wordpress设计的网站sem推广什么意思
  • 在线做txt下载网站国外搜索引擎排名
  • 怎么看网站用什么平台做的网站推广引流
  • dw如何用表格来做网站seo教程网站优化推广排名
  • 凡科删除建设的网站营销推广的平台
  • 为什么企业网站不是开源系统百度号码认证平台官网
  • 潍坊网站制作熊掌号5188关键词挖掘
  • 彩票类网站怎么做推广东营网站建设