| ||||||||||
| 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 | |||||||||
纪念我的第100题,HOHO#include<iostream.h>
#include<string.h>
#include <stdio.h>
#include<math.h>
int main()
{
int i,n,s,d,max,min;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s>>d;
for(max=s/2;max<=s;max++)
{
min=s-max;
if(max-min==d)
{
cout<<max<<" "<<min<<endl;break;
}
}
if(max>s) {cout<<"impossible"<<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