# include <stdio.h> void main() { int sum1, sum; sum = 0; sum1 = 0; for (int i=1; i<=100; i++) { if (i%2 != 0) { sum = sum + i; sum1++; } } printf("平均值为:%f\n", (float)sum/sum1); }