程序如下:
#include<iostream>
using namespace std;
int main()
{
int n,m,x,y;
for(;;)
{
cin>>n>>m;
if(n==0&&m==0) break;
if((m%2)==0&&2*n-(m/2)>=0&&(m/2)-n>=0)
{
x=2*n-(m/2);
y=(m/2)-n;
cout<<x<<" "<<y<<endl;
}
else
cout<<"Error"<<endl;
}
return 0;
}