Trang chủ
Bài viết mới
Diễn đàn
Bài mới trên hồ sơ
Hoạt động mới nhất
VIDEO
Mùa Tết
Văn Học Trẻ
Văn Học News
Media
New media
New comments
Search media
Đại Học
Đại cương
Chuyên ngành
Triết học
Kinh tế
KHXH & NV
Công nghệ thông tin
Khoa học kĩ thuật
Luận văn, tiểu luận
Phổ Thông
Lớp 12
Ngữ văn 12
Lớp 11
Ngữ văn 11
Lớp 10
Ngữ văn 10
LỚP 9
Ngữ văn 9
Lớp 8
Ngữ văn 8
Lớp 7
Ngữ văn 7
Lớp 6
Ngữ văn 6
Tiểu học
Thành viên
Thành viên trực tuyến
Bài mới trên hồ sơ
Tìm trong hồ sơ cá nhân
Credits
Transactions
Xu: 0
Đăng nhập
Đăng ký
Có gì mới?
Tìm kiếm
Tìm kiếm
Chỉ tìm trong tiêu đề
Bởi:
Hoạt động mới nhất
Đăng ký
Menu
Đăng nhập
Đăng ký
Install the app
Cài đặt
Chào mừng Bạn tham gia Diễn Đàn VNKienThuc.com -
Định hướng Forum
Kiến Thức
- HÃY TẠO CHỦ ĐỀ KIẾN THỨC HỮU ÍCH VÀ CÙNG NHAU THẢO LUẬN Kết nối:
VNK X
-
VNK groups
| Nhà Tài Trợ:
BhnongFood X
-
Bhnong groups
-
Đặt mua Bánh Bhnong
CÔNG NGHỆ
Công Nghệ Thông Tin
Code
Tìm hiểu về lớp BitArray trong C#
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Trả lời chủ đề
Nội dung
<blockquote data-quote="uocmo_kchodoi" data-source="post: 177636" data-attributes="member: 165510"><p><span style="font-size: 18px"><a href="https://vnkienthuc.com/forums/code.377/" target="_blank">Lớp BitArray</a> quản lý một mảng của các giá trị bit, được biểu diễn như là Boolean, là cái mà true biểu thị bởi bit on (1) và false biểu thị bit là off (0).</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px">Nó được sử dụng khi bạn cần lưu trữ các bit nhưng không biết số bit trước. Bạn có thể truy cập vào các phần tử từ bộ sưu tập BitArray bằng cách sử dụng một chỉ số nguyên, bắt đầu từ số không.</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #0000ff"><strong>Phương thức và Thuộc tính của lớp BitArray trong C#</strong></span></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><strong><em>Dưới đây liệt kê các thuộc tính được sử dụng phổ biến của lớp BitArray trong C#:</em></strong></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">Count:</span> Lấy số phần tử được chứa trong BitArray</span></p><p><span style="font-size: 18px"><span style="color: #ff8000">IsReadOnly:</span> Lấy một giá trị chỉ rằng có hay không BitArray là read-only</span></p><p><span style="font-size: 18px"><span style="color: #ff8000">Item</span>: Lấy hoặc thiết lập giá trị của bit tại vị trí đã xác định trong BitArray</span></p><p><span style="font-size: 18px"><span style="color: #ff8000">Length: </span>Lấy hoặc thiết lập số phần tử trong BitArray</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><strong>Bảng dưới</strong></em><a href="https://vnkienthuc.com/threads/tim-hieu-ve-phuong-thuc-nac-danh-trong-c.77386/" target="_blank"><em><strong> liệt kê các phương thức</strong></em></a><em><strong> được sử dụng phổ biến của lớp BitArray trong C#:</strong></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">1 public BitArray And(BitArray value);</span></span></p><p><span style="font-size: 18px">Thực hiện hoạt động bitwise AND trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">2 public bool Get(int index);</span></span></p><p><span style="font-size: 18px">Lấy giá trị của bit tại một vị trí đã xác định trong BitArray</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">3 public BitArray Not();</span></span></p><p><span style="font-size: 18px">Đảo ngược tất cả giá trị bit trong BitArray hiện tại, để mà các phần tử được thiết lập là true được chuyển đổi thành false, và các phần tử được thiết lập là false được chuyển đổi thành true</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">4 public BitArray Or(BitArray value);</span></span></p><p><span style="font-size: 18px">Thực hiện <a href="https://vnkienthuc.com/threads/tim-hieu-ve-lop-queue-trong-c.77383/" target="_blank">hoạt động bitwise OR </a>trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">5 public void Set(int index, bool value);</span></span></p><p><span style="font-size: 18px">Thiết lập bit tại một vị trí đã xác định trong BitArray tới value đã cho</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">6 public void SetAll(bool value);</span></span></p><p><span style="font-size: 18px">Thiết lập tất cả bit trong BitArray tới value đã cho</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><span style="color: #ff8000">7 public BitArray Xor(BitArray value);</span></span></p><p><span style="font-size: 18px">Thực hiện hoạt động bitwise Exclusive OR trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định</span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><strong>Ví dụ</strong></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3">using System;</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3">using System.Collections;</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3">namespace VietJackCsharp</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3">{</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> class TestCsharp</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> {</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> static void Main(string[] args)</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> {</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> Console.WriteLine("Vi du minh hoa BitArray trong C#");</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> Console.WriteLine("-------------------------------------");</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> SortedList ht = new SortedList();</span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> //tao hai bit array co kich co la 8</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> BitArray ba1 = new BitArray(8);</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> BitArray ba2 = new BitArray(8);</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> byte[] a = { 60 };</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> byte[] b = { 13 };</span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> //luu giu gia tri 60 va 13 vao trong bit array</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> ba1 = new BitArray(a);</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> ba2 = new BitArray(b);</span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> //hien thi noi dung cua ba1</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> Console.WriteLine("Hien thi cac phan tu cua ba1: 60");</span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> for (int i = 0; i < ba1.Count; i++)</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> {</span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"> Console.Write("{0, -6} ", ba1<em>);</em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> }</em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> Console.WriteLine();</em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> //hien thi noi dung cua ba2</em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> Console.WriteLine("Hien thi cac phan tu cua ba2: 13");</em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> for (int i = 0; i < ba2.Count; i++)</em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> {</em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em> Console.Write("{0, -6} ", ba2<em>);</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> }</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> Console.WriteLine();</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> BitArray ba3 = new BitArray(8);</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> ba3 = ba1.And(ba2);</em></em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> //hien thi noi dung cua ba3</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> Console.WriteLine("Cac phan tu cua ba3 sau hoat dong AND la: 12");</em></em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> for (int i = 0; i < ba3.Count; i++)</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> {</em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em> Console.Write("{0, -6} ", ba3<em>);</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> }</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> Console.WriteLine();</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> ba3 = ba1.Or(ba2);</em></em></em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> //hien thi noi dung cua ba3</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> Console.WriteLine("Cac phan tu cua ba3 sau hoat dong OR la: 61");</em></em></em></span></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> for (int i = 0; i < ba3.Count; i++)</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> {</em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em> Console.Write("{0, -6} ", ba3<em>);</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> }</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> Console.WriteLine();</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> </em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> Console.ReadKey();</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> }</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em> }</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><span style="color: #5900b3"><em><em><em><em>}</em></em></em></em></span></em></span></p><p><span style="font-size: 18px"><em><em><em><em>Nếu bạn không sử dụng </em></em></em></em><a href="https://vnkienthuc.com/threads/tim-hieu-ve-lop-stack-trong-c.77362/" target="_blank"><em><em><em><em>lệnh Console.ReadKey();</em></em></em></em></a><em><em><em><em> thì chương trình sẽ chạy và kết thúc luôn (nhanh quá đến nỗi bạn không kịp nhìn kết quả). Lệnh này cho phép chúng ta nhìn kết quả một cách rõ ràng hơn.</em></em></em></em></span></p><p><span style="font-size: 18px"></span></p><p><span style="font-size: 18px"><em><em><em><em>Biên dịch và chạy chương trình C# trên sẽ cho kết quả sau:</em></em></em></em></span></p><p><span style="font-size: 18px"></span></p><p style="text-align: center"><span style="font-size: 18px"><em><em><em><em><img src="https://vietjack.com/csharp/images/bitarray.PNG" alt="" class="fr-fic fr-dii fr-draggable " data-size="" style="" /></em></em></em></em></span></p><p></p><p style="text-align: center"></p><p></p><p style="text-align: right"><em><em><em>Nguồn: Sưu tầm</em></em></em></p></blockquote><p></p>
[QUOTE="uocmo_kchodoi, post: 177636, member: 165510"] [B][SIZE=5] [/SIZE][/B][SIZE=5][URL='https://vnkienthuc.com/forums/code.377/']Lớp BitArray[/URL] quản lý một mảng của các giá trị bit, được biểu diễn như là Boolean, là cái mà true biểu thị bởi bit on (1) và false biểu thị bit là off (0). Nó được sử dụng khi bạn cần lưu trữ các bit nhưng không biết số bit trước. Bạn có thể truy cập vào các phần tử từ bộ sưu tập BitArray bằng cách sử dụng một chỉ số nguyên, bắt đầu từ số không. [COLOR=#0000ff][B]Phương thức và Thuộc tính của lớp BitArray trong C#[/B][/COLOR] [B][I]Dưới đây liệt kê các thuộc tính được sử dụng phổ biến của lớp BitArray trong C#:[/I][/B] [COLOR=#ff8000]Count:[/COLOR] Lấy số phần tử được chứa trong BitArray [COLOR=#ff8000]IsReadOnly:[/COLOR] Lấy một giá trị chỉ rằng có hay không BitArray là read-only [COLOR=#ff8000]Item[/COLOR]: Lấy hoặc thiết lập giá trị của bit tại vị trí đã xác định trong BitArray [COLOR=#ff8000]Length: [/COLOR]Lấy hoặc thiết lập số phần tử trong BitArray [I][B]Bảng dưới[/B][/I][URL='https://vnkienthuc.com/threads/tim-hieu-ve-phuong-thuc-nac-danh-trong-c.77386/'][I][B] liệt kê các phương thức[/B][/I][/URL][I][B] được sử dụng phổ biến của lớp BitArray trong C#:[/B][/I] [COLOR=#ff8000]1 public BitArray And(BitArray value);[/COLOR] Thực hiện hoạt động bitwise AND trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định [COLOR=#ff8000]2 public bool Get(int index);[/COLOR] Lấy giá trị của bit tại một vị trí đã xác định trong BitArray [COLOR=#ff8000]3 public BitArray Not();[/COLOR] Đảo ngược tất cả giá trị bit trong BitArray hiện tại, để mà các phần tử được thiết lập là true được chuyển đổi thành false, và các phần tử được thiết lập là false được chuyển đổi thành true [COLOR=#ff8000]4 public BitArray Or(BitArray value);[/COLOR] Thực hiện [URL='https://vnkienthuc.com/threads/tim-hieu-ve-lop-queue-trong-c.77383/']hoạt động bitwise OR [/URL]trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định [COLOR=#ff8000]5 public void Set(int index, bool value);[/COLOR] Thiết lập bit tại một vị trí đã xác định trong BitArray tới value đã cho [COLOR=#ff8000]6 public void SetAll(bool value);[/COLOR] Thiết lập tất cả bit trong BitArray tới value đã cho [COLOR=#ff8000]7 public BitArray Xor(BitArray value);[/COLOR] Thực hiện hoạt động bitwise Exclusive OR trên các phần tử trong BitArray hiện tại với các phần tử tương ứng trong BitArray đã xác định [B]Ví dụ[/B] [I][COLOR=#5900b3]using System;[/COLOR][/I] [I][COLOR=#5900b3]using System.Collections;[/COLOR][/I] [I][COLOR=#5900b3]namespace VietJackCsharp[/COLOR][/I] [I][COLOR=#5900b3]{[/COLOR][/I] [I][COLOR=#5900b3] class TestCsharp[/COLOR][/I] [I][COLOR=#5900b3] {[/COLOR][/I] [I][COLOR=#5900b3] static void Main(string[] args)[/COLOR][/I] [I][COLOR=#5900b3] {[/COLOR][/I] [I][COLOR=#5900b3] Console.WriteLine("Vi du minh hoa BitArray trong C#");[/COLOR][/I] [I][COLOR=#5900b3] Console.WriteLine("-------------------------------------");[/COLOR][/I] [I][COLOR=#5900b3] SortedList ht = new SortedList();[/COLOR][/I] [I][COLOR=#5900b3] //tao hai bit array co kich co la 8[/COLOR][/I] [I][COLOR=#5900b3] BitArray ba1 = new BitArray(8);[/COLOR][/I] [I][COLOR=#5900b3] BitArray ba2 = new BitArray(8);[/COLOR][/I] [I][COLOR=#5900b3] byte[] a = { 60 };[/COLOR][/I] [I][COLOR=#5900b3] byte[] b = { 13 };[/COLOR][/I] [I][COLOR=#5900b3] //luu giu gia tri 60 va 13 vao trong bit array[/COLOR][/I] [I][COLOR=#5900b3] ba1 = new BitArray(a);[/COLOR][/I] [I][COLOR=#5900b3] ba2 = new BitArray(b);[/COLOR][/I] [I][COLOR=#5900b3] //hien thi noi dung cua ba1[/COLOR][/I] [I][COLOR=#5900b3] Console.WriteLine("Hien thi cac phan tu cua ba1: 60");[/COLOR][/I] [I][COLOR=#5900b3] for (int i = 0; i < ba1.Count; i++)[/COLOR][/I] [I][COLOR=#5900b3] {[/COLOR][/I] [I][COLOR=#5900b3] Console.Write("{0, -6} ", ba1[I]);[/I][/COLOR][/I] [I][COLOR=#5900b3][I] }[/I][/COLOR][/I] [I][COLOR=#5900b3][I] Console.WriteLine();[/I][/COLOR][/I] [I][COLOR=#5900b3][I] //hien thi noi dung cua ba2[/I][/COLOR][/I] [I][COLOR=#5900b3][I] Console.WriteLine("Hien thi cac phan tu cua ba2: 13");[/I][/COLOR][/I] [I][COLOR=#5900b3][I] for (int i = 0; i < ba2.Count; i++)[/I][/COLOR][/I] [I][COLOR=#5900b3][I] {[/I][/COLOR][/I] [I][COLOR=#5900b3][I] Console.Write("{0, -6} ", ba2[I]);[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] }[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] Console.WriteLine();[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] BitArray ba3 = new BitArray(8);[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] ba3 = ba1.And(ba2);[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] //hien thi noi dung cua ba3[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] Console.WriteLine("Cac phan tu cua ba3 sau hoat dong AND la: 12");[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] for (int i = 0; i < ba3.Count; i++)[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] {[/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I] Console.Write("{0, -6} ", ba3[I]);[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] }[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] Console.WriteLine();[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] ba3 = ba1.Or(ba2);[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] //hien thi noi dung cua ba3[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] Console.WriteLine("Cac phan tu cua ba3 sau hoat dong OR la: 61");[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] for (int i = 0; i < ba3.Count; i++)[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] {[/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I] Console.Write("{0, -6} ", ba3[I]);[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] }[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] Console.WriteLine();[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] [/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] Console.ReadKey();[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] }[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I] }[/I][/I][/I][/I][/COLOR][/I] [I][COLOR=#5900b3][I][I][I][I]}[/I][/I][/I][/I][/COLOR][/I] [I][I][I][I]Nếu bạn không sử dụng [/I][/I][/I][/I][URL='https://vnkienthuc.com/threads/tim-hieu-ve-lop-stack-trong-c.77362/'][I][I][I][I]lệnh Console.ReadKey();[/I][/I][/I][/I][/URL][I][I][I][I] thì chương trình sẽ chạy và kết thúc luôn (nhanh quá đến nỗi bạn không kịp nhìn kết quả). Lệnh này cho phép chúng ta nhìn kết quả một cách rõ ràng hơn.[/I][/I][/I][/I] [I][I][I][I]Biên dịch và chạy chương trình C# trên sẽ cho kết quả sau:[/I][/I][/I][/I] [/SIZE] [CENTER][SIZE=5][I][I][I][I][IMG]https://vietjack.com/csharp/images/bitarray.PNG[/IMG][/I][/I][/I][/I][/SIZE][/CENTER] [SIZE=5][/SIZE] [CENTER][SIZE=5][/SIZE][/CENTER] [SIZE=5][I][I][I] [/I][/I][/I][/SIZE] [RIGHT][I][I][I]Nguồn: Sưu tầm[/I][/I][/I][/RIGHT] [/QUOTE]
Tên
Mã xác nhận
Gửi trả lời
CÔNG NGHỆ
Công Nghệ Thông Tin
Code
Tìm hiểu về lớp BitArray trong C#
Top