Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Delegates, events
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public delegate int TwoInt(int a,int b); public delegate bool TrueFalse(bool T1,bool T2); public class StaticFunctions { public static bool Bool(bool T1,bool T2) { if (T1 = true){return true;} else {return false;} } public static int DivideStatic(int a, int b) { Console.WriteLine("DivideStatic Func is working"); return a/b; } } public class Program { public static void Main(string[] args) { TwoInt Event; TwoInt Sum = (int a,int b)=>a+b; TwoInt Multy =(a,b)=> a*b; TwoInt Divide =(a,b)=>a/b; TwoInt DVD = StaticFunctions.DivideStatic; Event = Sum; Event += DVD; Event += Multy; Event += Divide; //TwoInt Multi = new TwoInt(5,6); Console.WriteLine("Sum = {0}", Sum(2,1)); Console.WriteLine("Sum = {0}", Multy(2,4)); Console.WriteLine("Sum = {0}", Event(9,3)); TrueFalse Func = StaticFunctions.Bool; Console.WriteLine("Sum = {0}", Func(true,false)); } } }
run
|
edit
|
history
|
help
0
Pot
Find if the given word occurs in the string necessarily in that order.
aaa
test1
Command design pattern
Basic event
Sort the chars through LINQ
Need to convert datetime containg '/' to '-' format
problem version 2
Stacks: Balanced Brackets