KO CSharp Operator Comparison - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
๋น๊ต
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
์ซ์๊ฐ์ ์์๋ฅผ ๋น๊ตํ์ฌ bool๋ฅผ ๋ฐํํฉ๋๋ค. ์ฌ์ฉ์ ์ ํ์ ๋ํด ์ฐ์ฐ์๋ฅผ ์ ์ธํ ์ ์์ต๋๋ค.
๊ฐ๋จํ ์์ (Example.cs)
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
int count = 3;
System.Console.WriteLine(count > 2);
๊ฒฐ๊ณผ:
True
ํต์ฌ๋ก
left < right / left >= right
์์ 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
int value = 12;
Console.WriteLine($"{value < 15}:{value > 5}:{value <= 12}:{value >= 12}");
}
}
์์ 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
decimal balance = 12.5M, price = 8M;
Console.WriteLine(balance >= price ? "Enough" : "Missing");
}
}
๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.