Posted on 2011-11-19 14:10
C小加 閱讀(12047)
評論(1) 編輯 收藏 引用 所屬分類:
解題報告
求12個月工資的平均數。這個題的難度和1001差不多吧
#include <iostream>
using namespace std;
int main()
{
int n=12;
float sum=0.0;
float a;
while(n--)
{
cin>>a;
sum+=a;
}
cout<<"$"<<sum/12<<endl;
return 0;
}