算术运算符
static void Main(string[] args) { //算术运算符: + - * / % //演示:某学生三门功课的成绩分别是: 语文85 数学 95 英语 75 求总分和平均分; double douChinese = 85; double douMath = 95; double douEnglish = 74; Console.WriteLine("三门课的总分为{0},平均分为{1}", douChinese + douMath + douEnglish, Math.Round((douChinese + douMath + douEnglish) / 3,1)); Console.ReadKey(); }
static void Main(string[] args) { int intNum1 = 100; int intNum2 = 33; Console.WriteLine("两个数字的和为:{0}", intNum1 + intNum1); Console.ReadKey(); }
static void Main(string[] args) { double pi = 3.14; double douBanJin = 5; Console.WriteLine("圆的面积是:{0},周长是:{1};", Math.Round(pi * douBanJin * douBanJin, 2), Math.Round(pi * douBanJin * 2, 2)); Console.ReadKey(); }