| ||||||||||
| 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>
#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