1、
#include <stdio.h>
int main(void)
{
float x1 = -0.01;
int x2 = 0;
int i;
float sum1 = 0.0 , sum2 = 0.0;
for(i = 0; i <= 100; i++)
{
x1 += 0.01;
sum1 += x1;
sum2 += (x2++ / 100.0);
}
printf("x = %f x = %f
", sum1, sum2);
return 0;
}