//+ - * / %(取余)
int num = 10 + 10;//20
int num1 = 10 - 10;//0
int num2 = 10 * 10;//100
int num3 = 10 / 10;//1
int num4 = 10 % 3;//1
Console.WriteLine(num4);
//算数运算符优先级和数学中是一样的
//先算乘除再算加减 取余运算符优先2缓和 乘除一样
//提升优先级使用括号
int num5 = 10 + 10 % 10;
Console.WriteLine(num5);
//符合算数运算符
//+= -= /= *= %=
int count = 10;
//在自身的基础上加上一个数值
count += 5;//是一种简写形式 是count = count + 5的简写形式
//在自身的基础上减去一个数值
count -= 5;//count = count -5
//在自身的基础上乘以一个数值
count *= 5;//count = count * 5
//在自身的基础上除以一个数值
count /= 5;//count = count / 5
//在自身的基础上取余一个数值
count %= 5;// count = count % 5
Console.WriteLine(count);
//复合运算符
//++ --
int count1 = 10;
//在自身的基础上加一
//count++;//count1 = count1 + 1
//Console.WriteLine(count1);
//在自身的基础上加一
//count1++;//count1 = count +1
//Console.WriteLine(count);
//Console.WriteLine(count1++);//10
//Console.WriteLine(++count);//11
//int num6 = count++;//10
//int num7 = ++count;//12
//int num8 = ++count1 + count1++ + count1++ + ++count1;
//放的值 11 11 12 14=48
//计算完的结果 11 12 13 14
//int num9 = count1++ + count1++ + ++count1 + count1++ + ++count1;
//--是在自身的基础上减1
int num10 = count1++ + count1-- + --count1 + ++count1 + --count1 + count1--;
Console.WriteLine(num10);
Console.ReadLine();
//++ -- 是自增和自减运算符
//运算符在前先运算 运算符在后先赋值