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 |
一点高精都不用的#include <iostream> using namespace std; double a[12]; int main () { int ans =0; for (int i=0; i<12; i++) { cin>>a[i]; ans += a[i]*1000; } ans /= 12; if (ans %10 >= 5) { ans /= 10; cout<<"$"<<ans/100<<"."<<ans%100 + 1; } else { ans /=10; cout<<"$"<<ans/100<<"."<<ans%100; } system ("pause"); return 0; } 呵呵! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator