读书人

POJ 1004(追加)

发布时间: 2013-10-15 16:47:37 作者: rapoo

POJ 1004(累加)

/* * POJ_1004.cpp * *  Created on: 2013年10月14日 *      Author: Administrator */#include <iostream>#include <cstdio>using namespace std;int main(){double n;double sum = 0;int counter = 0;while(true){counter++;if(counter > 12){break;}scanf("%lf",&n);sum += n;}printf("$%.2lf\n",sum/12);return 0;}

读书人网 >编程

热点推荐