| ||||||||||
| 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:注意这题要考虑 (s-d)是奇数的情况就可以了…………In Reply To:注意这题要考虑 (s-d)是奇数的情况就可以了………… Posted by:summery at 2006-04-07 16:59:20 > #include<iostream>
> using namespace std;
>
> int main()
> {
> int n;
> int sum;
> int mul;
> cin>>n;
> for(int i =0; i<n; i++)
> {
> cin>>sum>>mul;
> if(sum<mul)
> cout<<"impossible"<<endl;
> else if((sum-mul)%2==0)
> cout<<(sum+mul)/2<<" "<<(sum-mul)/2<<endl;
> else cout<<"impossible"<<endl;//如果s-d是奇数也是impossible……
> }
> return 0;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator