一个for循环不能达到自己的母的,不知道为什么?

791阅读 2评论2012-12-11 古丁高手
分类:C/C++

#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;
 
}
上一篇:max函数!问题!
下一篇:perl&python的比较(在ibm论坛转过来)!

文章评论