5 public delegate void TestDelegate ();
7 static long sum_i
, sum_j
, sum_k
;
8 static ulong sum_p
, sum_q
;
10 public static int Test (int p
)
12 TestDelegate d
= null;
13 for (int i
= 1; i
<= 5; i
++) {
14 for (int j
= i
; j
<= 8; j
++) {
16 TestDelegate temp
= delegate {
17 Console
.WriteLine ("i = {0}, j = {1}, k = {2}, p = {3}",
22 sum_p
+= (ulong) (1 << p
);
25 ulong q
= (ulong) (i
* j
);
28 Console
.WriteLine ("Nested i = {0}, j = {1}, " +
29 "k = {2}, p = {3}, q = {4}",
38 Console
.WriteLine ("SUM i = {0}, j = {1}, k = {2}, p = {3}",
39 sum_i
, sum_j
, sum_k
, sum_p
);
47 if (sum_p
!= 1825434804)
49 sum_i
= sum_j
= sum_k
= 0;
52 Console
.WriteLine ("SUM i = {0}, j = {1}, k = {2}, p = {3}, q = {4}",
53 sum_i
, sum_j
, sum_k
, sum_p
, sum_q
);
61 if (sum_p
!= 18446744073385831629)
68 public static int Main ()
70 int result
= Test (5);
72 Console
.WriteLine ("ERROR: {0}", result
);
74 Console
.WriteLine ("OK");