POJ 2714 平均年龄 解题报告

POJ 2714 平均年龄 解题报告

编号:2714

 

考查点:简单计算题

 

思路: answer = sum/count

 

提交情况: 一次AC..

 

Source Code

 


//POJ Grids 2714
#include <iostream>
using namespace std;

int main()
{
    
int n;float sum = 0.0f;
    cin
>>n;
    
int temp = n;
    
while (temp--)
    {
        
int m;
        cin
>>m;
        sum 
+= m;
    }

    printf(
"%.2f",sum/n);
}

总结: 水..

 

                                                       By   Ns517

                                                      Time 09.02.22

posted @ 2009-02-22 21:48  端木  阅读(402)  评论(0编辑  收藏  举报