| ||||||||||
| 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;
int main()
{
int i,m,s;
while(cin>>m)
{
s=0;
for(i=1;s<m;i++)
s+=i;
if((s-m)%2==0)
cout<<(i-1)<<endl;
else
cout<<(i+1)<<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