📜  c# 使用条件设置变量 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:43.457000             🧑  作者: Mango

代码示例1
bool newOrderReceived = true;
int newOrderSize      = 23;
int backlogOrders     = 124;

int pendingOrders = newOrderReceived ?
    backlogOrders + newOrderSize :
    backlogOrders;