| ||||||||||
| 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 | |||||||||
水的太水了……要判断两数和以及两数差是否是偶数-function attached#include<iostream>
using namespace std;
int main()
{
int cyle,a,b;
cin>>cyle;
while(cyle--) {
cin>>a>>b;
if(a<b||(a+b)%2||(a-b)%2)cout<<"impossible"<<endl;
else
{
cout<<(a+b)/2<<" "<<(a-b)/2<<endl;
}
}
return 1;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator