Bài viết hôm nay mình sẽ giới thiệu đến các bạn những kĩ thuật, phong cách lập trình lập tốt. Nếu còn thiếu sót gì thì các bạn có thể comment ở dưới bài viết nhé ! Mục đích của một phong cách lập trình tốt là làm cho chương trình trở nên dễ đọc […]
#bài tập c++
Cách cài đặt danh sách liên kết đơn trong c++
Bài viết hôm này mình sẽ hướng dẫn các bạn cách cài đặt danh sách liên kết đơn sử dụng code c++. Danh sách liên kết đơn là gì ? Danh sách liên kết đơn là một cấu trúc dữ liệu thường dùng trong các ngôn ngữ lập trình. Các bạn có thể xem hình […]
Cách cài đặt queue trong c++
Bài viết hôm nay mình sẽ hướng dẫn các bạn cách cài đặt queue có sử dụng template trong ngôn ngữ c++. Nếu bạn chưa biết template là gì thì có thể xem tại đây. Queue là gì: Queue hay còn gọi là hàng đợi, là một cấu trúc dữ liệu thường dùng trong các ngôn […]
Viết hàm đếm số lượng số nguyên tố nhỏ hơn 100 trong mảng
Bài toán: Viết hàm đếm số lượng số nguyên tố nhỏ hơn 100 trong mảng một chiều các số nguyên dương. Input 1 5 7 103 97 51 Output 3 Ý tưởng đếm số lượng số nguyên tố Đầu tiên các bạn phải viết một hàm kiểm tra số nguyên tố, nếu các bạn […]
Hãy liệt kê các vị trí chẵn lớn nhất trong mảng
Bài toán: Hãy liệt kê các vị trí chẵn lớn nhất trong mảng một chiều các số nguyên. Input: 3 5 6 6 5 Output: Cac vi tri la: 3 4 Cách liệt kê các vị trí chẵn lớn nhất trong mảng một chiều Cách làm là chúng ta sẽ tìm ra phần tử […]