123456789101112131415161718 |
- #include <stdio.h>
- int main() {
- int count = 0;
- float sum = 0.0;
- while(sum<100000.0) {
- float money;
- printf("请依次输入捐款钱数:");
- scanf("%f",&money);
- sum += money;
- count++;
- }
-
- printf("第%d个人捐款之后达到10万+\n",count);
- printf("平均每人捐款:%.2f",sum / count);
- return 0;
- }
|