码迷,mamicode.com
首页 > 其他好文 > 详细

poj1004

时间:2017-05-07 20:07:55      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:平均数   iostream   func   cin   name   function   type   roc   word   

//求平均数

#include<iostream>
using namespace std;
int main()
{
	double n,ave,s;
	s=0;
	for(int i=0;i<12;i++)
	{
		cin>>n;
		s+=n;
	}
	ave=s/12;
	cout<<"$"<<ave<<endl;
	return 0;
 } 

poj1004

标签:平均数   iostream   func   cin   name   function   type   roc   word   

原文地址:http://www.cnblogs.com/mykonons/p/6821805.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!