立即學習:https://edu.csdn.net/course/play/20589/257728?utm_source=blogtoedu
_______________________________________________________________________________________________________
人生碌碌,競短論長,卻不道榮枯有數,得失難忘。
_______________________________________________________________________________________________________
運算符號的優先級
從高至低
++ -- +(正號)-(負號)
* / %
+ -
+= *= /= -= %=
>>括號內優先級高,可以多層嵌套,必須成對出現。
int n1 = 10 + 5;
int n2 = 10 + 5 * 2;
int n3 = 10 % 3 + 5 * 2;
Console.WriteLine("n1="+n1+" ,n2="+n2+", n3="+n3);