关于delay还有while语句,有点不懂,谁给解释下!
# include <stdio.h>void delay(int z)
{
int x ,y;
for(x=z;x>0;x--)
for(y=10000;y>0;y--);
}
int main(void)
{
int i;
float sum = 0;
while(1)
{ for (i=1; i<=3; ++i)
{
delay(10000);
sum = sum + 1 / (float)(i);
printf("sum = %.20f\n", sum);
}
i=1;
sum=0;
}
}
帮忙给解释下每步,特别是关于delay 还有while语句的,我不怎么懂!