Khai báo Action<int> show = x => Console.WriteLine("S=" + x); và Action<int> twice = x => Console.WriteLine("T=" + (x * 2));. Tạo Action<int> chain = show; rồi chain = (Action<int>)Delegate.Combine(chain, twice); rồi chain = (Action<int>)Delegate.Combine(chain, show); rồi chain = (Action<int>)Delegate.Remove(chain, twice);. Đọc số n và gọi chain(n).
Một dòng chứa số nguyên n.
-1000 ≤ n ≤ 1000. Bắt buộc dùng Delegate.Combine và Delegate.Remove.
Hai dòng: S=n rồi S=n.
Đang tải editor...