using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Maximum { class Program { static void Main(string[] args) { Console.WriteLine("n:"); int n = int.Parse(Console.ReadLine()); double[] a = new double[n]; for (int v = 0; v < n; v++) { a[v] = double.Parse(Console.ReadLine()); } double max = a[0]; for (int i = 1; i < n; i++) { if (a[i] > max) max = a[i]; } //double t = z(a[],n); Console.WriteLine(Program.maximum(a, n)); Console.ReadLine(); } static double maximum(double[] a, int n) { double max = a[0]; for (int i = 1; i < n; i++) { if (a[i] > max) max = a[i]; } return max; } } }
تصویر خروجی برنامه ی ماکسیمم(Maximum):