Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:使用double的时候,编译器选择C++,不能选G++

Posted by silveryelf at 2011-09-21 21:29:27 on Problem 1004
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator