Advertisement
AIwinter

2 лаба ооп (list<>)

Oct 14th, 2022
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApp4
  5. {
  6.     internal class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             List<string> FavoriteCartoons = new() {"Bojack Horseman", "The Midnight Gospel", "Harley Quinn"};
  11.  
  12.             //FavoriteCartoons.Insert(2, "Rick and Morty");
  13.  
  14.             //FavoriteCartoons.Remove("Harley Quinn");
  15.             //FavoriteCartoons.RemoveAt(1);
  16.  
  17.             FavoriteCartoons.Sort();
  18.  
  19.             //Console.WriteLine(FavoriteCartoons[0]);
  20.  
  21.             foreach (var Cartoons in FavoriteCartoons)
  22.             {
  23.                 Console.WriteLine(Cartoons);
  24.             }
  25.  
  26.             Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement