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:求教高手,此题只能分组做么?有数学方法么?In Reply To:求教高手,此题只能分组做么?有数学方法么? Posted by:Nowitzki at 2007-02-23 18:50:21 算出的结果正确 但总是WA #include<iostream> #include<cmath> using namespace std; int main() { int times, find; double answer, temp; cin >> times; for (int i = 0; i < times; i ++) { cin >> find; answer = -0.5 + sqrt(0.0625 + find/2) * 2; temp = int(answer); if (answer - temp == 0) cout << temp << endl; else cout << find - (temp/2*temp + temp/2) << endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator