POJ 1004

POJ 1004

题意

求平均值

思路

水题

#include 
#include 
using namespace std;
int month = 12;
double balance,average,total;

int main (){
    for(month = 0;month < 12;month++){
        cin >> balance ;
        total += balance;
    }
    average = total/month;
    printf("$%.2f \n", average);
}

你可能感兴趣的:(POJ 1004)