• 2024-11-15抽奖-随机加权算法
    packagelotteryimport( "fmt" "math/rand" "sort" "time")typeLotterystruct{}funcNewLottery()*Lottery{ return&Lottery{}}typePrizestruct{ Namestring Stockint Weightint//权重}//