daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace lab10
  5. {
  6.     internal class Program
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             var l = new List<Vedomost>();
  11.             l.Add(new Vedomost("Name1", 4));
  12.             l.Add(new Vedomost("Name2", 3));
  13.             l.Add(new Vedomost("Name3", 5));
  14.             l.Sort(((vedomost, vedomost1) => vedomost.Mark.CompareTo(vedomost1.Mark)));
  15.             foreach (var vedomost in l)
  16.             {
  17.                 Console.WriteLine(vedomost.Name);
  18.             }
  19.            
  20.         }
  21.     }
  22.  
  23.     public class Vedomost
  24.     {
  25.         public int Mark;
  26.         public string Name;
  27.  
  28.         public Vedomost(string name, int mark)
  29.         {
  30.             Mark = mark;
  31.             Name = name;
  32.         }
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top