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

double 可以

Posted by tianyichen at 2015-09-24 12:22:34 on Problem 1004 and last updated at 2015-09-24 12:23:01
In Reply To:这题float能过, 但是double不行, 不知道为什么. Posted by:rambo9567 at 2015-09-24 00:28:17
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
double s=0,i;
cout<<fixed;
cout.precision(2);
for (int t=1;t<13;t++)
{cin>>i;s+=i;}
s/=12;
cout<<"$"<<s<<endl;
}

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