poj 1004 Financial Management(基础题)

来源:互联网 发布:出售一审淘宝店铺 编辑:程序博客网 时间:2024/06/11 15:48

题目链接:http://poj.org/problem?id=1004

题意:给出12个数,求平均数

题解:……

#include <stdio.h>int main() {    float ans = 0 , a;    for(int i=0;i<12;i++) {        scanf("%f",&a);        ans += a;        }    printf("$%.2f\n",ans/12);    return 0;    }