Sk=0-2*1-2*0-2*(-1).-2*k
=0-2(1+2+3+...+(-k))
当输出的k'=k-1<-50时
k<-49
∵k为整数∴k= -50
Sk=0-2(1+2+3+...+50)
=0-2(1+50)*50/2
= -51*50
= -2550
Sk=0-2*1-2*0-2*(-1).-2*k
=0-2(1+2+3+...+(-k))
当输出的k'=k-1<-50时
k<-49
∵k为整数∴k= -50
Sk=0-2(1+2+3+...+50)
=0-2(1+50)*50/2
= -51*50
= -2550