Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Habrahabr;
- namespace 256Day
- {
- private static class Program
- {
- [STAThread]
- private static void Main(string[] args)
- {
- (from obj in Habrahabr.Programmers
- where obj.IsActive
- order by obj.FIO asceding
- select obj).ForEach(Congratulate);
- Console.ReadLine();
- }
- private static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
- {
- if((collection == null) || (action == null))
- return;
- foreach(var obj in collection)
- action(obj);
- }
- private static void Congratulate(Programmer programmer)
- {
- Console.WriteLine("{0}, congratulations!", programmer.FI);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement