单选题

若有如下程序段,其中s、a、b、c均已定义为整型变量,且a、c均已赋值(c大于0)
s = a;
for (b = 1; b <= c; b++) s = s - 1;
则与上述程序段功能等价的赋值语句是()

A.

s = a - c;

B.

s = a - b;

C.

s = s - c;

D.

s = b - c;

发表评论

登录 后再回复