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;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- public delegate int Plus(int number);
- static void Main(string[] args)
- {
- Plus plusWat;
- int result;
- plusWat = Plus1;
- result = plusWat(1);
- Console.WriteLine(result);
- plusWat = Plus2;
- result = plusWat(1);
- Console.WriteLine(result);
- Console.WriteLine(DoeIets(6, Plus2));
- Console.ReadLine();
- }
- public static int DoeIets(int number, Plus function)
- {
- return function(number);
- }
- public static int Plus1(int number)
- {
- return number + 1;
- }
- public static int Plus2(int number)
- {
- return number + 2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement