Scratch算法-累加实现