15 lines
279 B
C++
15 lines
279 B
C++
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int a, b;
|
||
|
int outnum; // 输出的数字
|
||
|
cout << "请输入两个整数: ";
|
||
|
cin >> a >> b;
|
||
|
|
||
|
outnum = a > 0 ? (b > 0 ? a + b : a - b) : (b < 0 ? a * b : a - b);
|
||
|
cout << outnum << endl;
|
||
|
return 0;
|
||
|
}
|