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

我的写的虽然有点麻烦但运行绝对没有问题,但为什么就是WA????

Posted by lcj0227 at 2007-07-12 11:40:44 on Problem 1663
#include<iostream.h>
int main()
{
    int N,x,y,p;
    cin>>N;
    for(int i=1;i<=N;i++)
    {
        cin>>x>>y;
        if(x==y)
        {
            if(x%2==0)
              p=2*x;
            else
              p=2*x+1;
            cout<<p<<endl;
        }
        else if((x-y)==2&&x>=2)
        {
            if(x%2==0)
                p=2*x-2;
            else
                p=2*x-3;
            cout<<p<<endl;
        }
        else
         cout<<"No Number"<<endl;
        
    }
    return 0;
}

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