#include<iostream>
using namespace std;
void main()
{
int x,y,z;
cout<<"Please enter the value of x: ";
cin>>x;
cout<<endl;
cout<<"Please enter the value of y: ";
cin>>y;
cout<<endl;
if(x>0)
{
z=x*x+y*y;
cout<<z<<endl;
}
else if(x<0)
{
z=-(x*x+y*y);
cout<<z<<endl;
}
}
编译通过,工具VC++6.0