#include
#define TATAL 1000
int main()
{
float amount,sum;
int i;
for(i=1,amount=0;i<=1000;i++)
{
printf("input the amount : \n");
scanf("%f",&amount);
sum=sum+amount;
if(sum>=TATAL)
break;
}
printf("the sum amount is %f\n",sum);
printf("the aver is %f\n",sum/i);
return 0;
}
阅读(755) | 评论(2) | 转发(0) |