#include<stdio.h>
#include<math.h>
int main() {
float amount, aver, total=0.0;//个人捐款数,人均捐款数,总数
int i;
for ( i = 1; i<=1000; i++)
{
printf("请输入捐款数目:");
scanf_s("%f", &amount);
total = total + amount;
if (total >= 100000)
break;
}
aver = total / i;
printf("捐款人数:%d,人均捐款数:%f\n", i, aver);
}
10-06
1144
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交