| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:使用double的时候,编译器选择C++,不能选G++In Reply To:使用double的时候,编译器选择C++,不能选G++ Posted by:steven7gao at 2011-09-07 20:16:28 > 在用double数据类型的时候,还是要选择C++编译器。四舍五入的精度比较准确。
是么?
#include<iostream>
using namespace std;
double sum,x;
int main(void)
{
int i;
sum=0;
for(i=0;i<12;i++)
{
cin>>x;
sum+=x;
}
cout<<"$"<<sum/12<<endl;
return 0;
}
G++无压力AC啊
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator