5 public delegate void TestDelegate ();
7 static long sum_i
, sum_k
, sum_p
;
9 public static int Test (int p
)
11 TestDelegate d
= null;
12 for (int i
= 1; i
<= 5; i
++) {
14 TestDelegate temp
= delegate {
15 Console
.WriteLine ("i = {0}, k = {1}, p = {2}", i
, k
, p
);
24 Console
.WriteLine ("SUM i = {0}, k = {1}, p = {2}", sum_i
, sum_k
, sum_p
);
32 sum_i
= sum_k
= sum_p
= 0;
34 Console
.WriteLine ("SUM i = {0}, k = {1}, p = {2}", sum_i
, sum_k
, sum_p
);
40 if (sum_p
!= 1152385024)
45 public static int Main ()
47 int result
= Test (5);
49 Console
.WriteLine ("ERROR: {0}", result
);
51 Console
.WriteLine ("OK");