#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
int a,b;
cout<<"请输入a和b:";
cin>>a>>b;
if (abs(a)==abs(b))
cout<<"a="<
else cout<<"b="<
system("PAUSE");
return EXIT_SUCCESS;
}
#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
int a,b;
cout<<"请输入a和b:";
cin>>a>>b;
if (abs(a)==abs(b))
cout<<"a="< else cout<<"b="<
abs(x)
可以自己写吗:
x=x>0?x:-x;
Math.abs(x);
记得加头文件#include
abs(x)