Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections;
- namespace ConsoleApp4
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("\n 1) Array: ");
- var FavoriteFood = new string[] { "Apple", "Cake", "Pizza", "Salad" };
- //поиск наиб числа среди целых чисел в arraylist
- Console.WriteLine("\n 2) ArrayList: ");
- ArrayList pos = new() { 1, 2, 3 };
- pos.AddRange(FavoriteFood);
- pos.Remove("Apple");
- pos.Remove("Salad");
- int[] ar = (int[])pos.ToArray(typeof(int));
- int max1 = ar.Max();
- Console.WriteLine(max1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement