課程
/后端開發(fā)
/C#
/C#開發(fā)輕松入門
任務(wù)的答案是什么呀? 不會寫還有什么時候用== 這節(jié)課學(xué)的比較迷
2017-06-13
源自:C#開發(fā)輕松入門 2-19
正在回答
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int age = 4;//年齡
? ? ? ? ? ? if (age < 6 ?|| age > 60)
? ? ? ? ? ? ? ? Console.WriteLine("請坐愛心座!");
? ? ? ? ? ? else
? ? ? ? ? ? ? ? Console.WriteLine("請堅(jiān)持一下!");
? ? ? ? }
? ? }
}
第二個就是:==號在判斷語句里面用的。
CXTurn 提問者
int age = 4;//年齡
? ? ? ? ? ? if (age < 6? || age > 60)
||邏輯或 年齡小于6歲或者大于60歲
==表示等于 比較兩個數(shù)據(jù)是否相等的時候使用
不等于是 !=
大概是這樣吧 (*^__^*) 嘻嘻……
舉報(bào)
本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)
1 回答2-19
1 回答2—19課任務(wù)怎么做,怎么添加?
3 回答答案錯了,輸出的就是19吧?
2 回答2-11
3 回答4-2
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-06-13
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int age = 4;//年齡
? ? ? ? ? ? if (age < 6 ?|| age > 60)
? ? ? ? ? ? ? ? Console.WriteLine("請坐愛心座!");
? ? ? ? ? ? else
? ? ? ? ? ? ? ? Console.WriteLine("請堅(jiān)持一下!");
? ? ? ? }
? ? }
}
第二個就是:==號在判斷語句里面用的。
2021-05-11
int age = 4;//年齡
? ? ? ? ? ? if (age < 6? || age > 60)
? ? ? ? ? ? ? ? Console.WriteLine("請坐愛心座!");
? ? ? ? ? ? else
? ? ? ? ? ? ? ? Console.WriteLine("請堅(jiān)持一下!");
2017-06-13
||邏輯或 年齡小于6歲或者大于60歲
==表示等于 比較兩個數(shù)據(jù)是否相等的時候使用
不等于是 !=
大概是這樣吧 (*^__^*) 嘻嘻……