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

show my code,没有打表

Posted by 20083331 at 2009-06-26 22:13:27 on Problem 1663
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    int n;
    cin>>n;
    while(n--)
    {
        int x,y;
        cin>>x>>y;
        int sum=x+y;
        if(x==y)
        {
            if(sum%4==0)
                cout<<sum<<endl;
            else
                cout<<sum-1<<endl;
        }
        else if(x==y+2)
        {
            if(sum%4==0)
                cout<<sum-1<<endl;
            else
                cout<<sum<<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