单项选择题

阅读下面的程序段:
sum=0
for i=1 to 3
for j=i to 4
for k=j to 5
sum=sum+1
next k
next j
next i
执行上面的三重循环后,sum的值为______。

A.14
B.23
C.28
D.30