回覆列表
  • 1 # 神經有問題的我

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ts01{ class Program { //計算三個整數的最大值 static int Max3(int a, int b, int c) { int maxValue = a; if(maxValue < b) { maxValue = b; } if(maxValue < c) { maxValue = c; } return maxValue; } //計算三個整數的最小值 static int Min3(int a, int b, int c) { int minValue = a; minValue = Math.Min(minValue, b); minValue = Math.Min(minValue, c); return minValue; } static void Main(string[] args) { int a = 10, b = 20, c = 30; Console.WriteLine("10, 20, 30 "s max value is:{0}", Max3(a, b, c)); Console.WriteLine("10, 20, 30 "s min value is:{0}", Min3(a, b, c)); } }}

  • 中秋節和大豐收的關聯?
  • 大眾汽車重量?