第22018题 单选
补全仅一个城市温度低于0的C++代码空缺

假设有两个城市:城市A和城市B,每个城市的温度都在-50到50摄氏度之间。当且仅当只有一个城市的温度低于0时输出1:即如果城市A的温度低于0而城市B大于等于0,或城市A的温度大于等于0而B小于0,则输出1,否则输出0,请补全代码中①和②处的内容。

#include<iostream>
using namespace std;
int main()
{
    int a,b;
    cin >> a >> b;
    if(①)
    {
        if(②)
        {
            cout << 1;
            return 0;
        }
    }

    if(a >= 0)
    {
        if(b < 0)
        {
            cout << 1;
            return 0;
        }
    }
    cout << 0;
    return 0;
}
A

a<0、b>=0

B

a>0、b<=0

C

a>=0、b>=0

D

a<0、b<0

提交0次 正确率0.00%
答案解析