Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我就是这么算的

Posted by soyboydoy at 2008-03-24 15:31:26 on Problem 3543
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator