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:Re:我就是这么算的 Posted by:crazyfeather at 2008-03-23 22:21:12 > #include <iostream> > > using namespace std; > int main() > { > int b,w; > while(cin>>b>>w) > { > int sum = 0; > if (b==0&&w==0) > cout << "Impossible" << endl; > else if (b==1&&w!=1||b!=1&&w==1||b==1&&w==1) > cout << "1" << endl; > else > { > if (b < w) > sum = 2*b+1; > else if (w < b) > sum = 2*w+1; > else if (w = b) > sum = w+b; > int i = 1; > while (i) > { > if (sum<i*i) > { > cout << i-1 << endl; > break; > } > else > i++; > } > } > } > return 0; > } if (a= b)????! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator