SOURCE

var s = 320  // 盈利金额

var r = 6 // 倍投次数

var m = 0.022 // 手续费


function test1(){
    var total = 0
    var before = 0
    for(i=1;i<(r+1);i++){

        var current = Math.pow(2,(i-1)) * s
        var fee = Math.ceil(current * m) 

        console.log(current + ' ' + '手续费:' + fee)
 
        total += current
    }
    
    console.log('sum:' + total)
}
test1()

/**
 * 123333
 */
function test2(){
    var total = 0
    var before = 0
    var start = 80

    for(i=1;i<(r+1);i++){

        if(before == 0){
            before = start
        }
        
        if(i == 1){
            console.log(start + ' ' + '手续费:' + Math.ceil(start * m) )
            total += start
        }else if(i == 2){
            var current = before * 2
            before = current
            total += current

            console.log(current + ' ' + '手续费:' + Math.ceil(current * m) )
        }else {
            var current = before * 3
            before = current
            total += current

            console.log(current + ' ' + '手续费:' + Math.ceil(current * m) )

        }
       
    }
     console.log('sum:' + total)
 
}

//test2()

/**
 * 122233
 */
function test3(){
     var total = 0
    var before = 0
    var start = 300

    for(i=1;i<(r+1);i++){

        if(before == 0){
            before = start
        }
        
        if(i == 1){
            console.log(start + ' ' + '手续费:' + Math.ceil(start * m) )
            total += start
        }else if(i == 2 || i == 3){
            var current = before * 2
            before = current
            total += current

            console.log(current + ' ' + '手续费:' + Math.ceil(current * m) )
        }else {
            var current = before * 2.5
            before = current
            total += current

            console.log(current + ' ' + '手续费:' + Math.ceil(current * m) )

        }
       
    }
     console.log('sum:' + total)
}

//test3()
console 命令行工具 X clear

                    
>
console