| ||||||||||
| 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:为什么老说是presentation error 大虾们帮帮忙!!In Reply To:为什么老说是presentation error 大虾们帮帮忙!! Posted by:cpp051000448166 at 2005-04-02 18:17:48 #include<iostream>
using namespace std;
int main()
{
int times, a, b;
cin >> times;
for (int i = 0; i < times; i ++)
{
cin >> a >> b;
if (a - b != 0 && a - b != 2)
cout << "No Number" << endl;
else if (a - b == 2)
{
if (a % 2 == 0)
cout << 2*a - 2 << endl;
else
cout << a/2*4 - 1 << endl;
}
else if (a - b == 0)
{
if (a % 2 == 0)
cout << 2*a << endl;
else
cout << a/2*4 + 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