Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Silnik s1 = new Silnik(150, 55.5, "Ford");
- //s1.Wyswietl();
- //Console.ReadKey();
- List<int> l1 = new List<int>();
- l1.Add(1);
- l1.Add(15);
- l1.Add(-3);
- l1.Add(44);
- Console.WriteLine(Max(l1));
- Console.ReadKey();
- }
- public static int Max(List<int> list)
- {
- int max=list[0];
- for (int i = 1; i < list.Count; i++)
- if (max < list[i])
- max = list[i];
- return max;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement