Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Problems
- {
- using System;
- internal class Program
- {
- private static int a = 0;
- static int F()
- {
- Console.WriteLine("Before [a = a + 3;] a = " + a);
- a = a + 3;
- Console.WriteLine("After [a = a + 3;] a = " + a);
- return 1;
- }
- public static void Main(string[] args)
- {
- Console.WriteLine("In Main, before F call: " + a);
- a += F();
- Console.WriteLine(a);
- // Кажется, что выведет 4.
- // Но выводит 1.
- // Пичиму?
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment