下列程序中,正确计算1,2,…,100 这100个自然数之和sum(初始值为 0)的是( )。
for(i=1;i<=100;i++)
sum+=i;
i=1;
while(i>100){
i++;
}
do{
}while(i<=100);
}while(i>100);