Bài viết hôm nay mình sẽ hướng dẫn các bạn cách cài đặt stack 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 lại tại đây. Stack là gì: Stack là một cấu trúc dữ liệu thường dùng phổ biến trong các ngôn ngữ lập trình. […]
#bài tập c++
Viết chương trình kiểm tra số nguyên dương có toàn chữ số chẵn hay không?
Bài viết hôm nay mình sẽ hướng dẫn các bạn cách viết chương trình kiểm tra số nguyên dương có toàn chữ số chẵn hay không. Nào chúng ta cùng bắt đầu thôi ! Input 2468 Output YES Cách kiểm tra số nguyên dương có toàn chữ số chẵn Cách làm là chúng […]
Cách tính sin cos trong c++
Trong c/c++ có thư viện math.h có chứa các hàm để tính sin cos, vậy có khi nào bạn thắc mắc các hàm đó sẽ tính như thế nào không ? Vậy hôm nay chúng ta cùng đi tìm cách tính sin cos trong c++ nhé! Cách tính sin trong c++ Sin x có thể […]
Thuật toán chèn phần tử vào một mảng bằng code c++
Bài viết hôm nay mình sẽ hướng dẫn các bạn cách chèn phần tử vào mảng một chiều sử dụng code c++. Giới thiệu cách chèn phần tử vào mảng Giả sử mảng của chúng ta có n phần tử: a0, a1, a2, a3, …, a(k-1), ak, …,a(n-1). Bây giờ bạn muốn chèn vào một […]
Bài 25. Tìm bội chung nhỏ nhất của 2 số
Tìm bội chung nhỏ nhất của 2 số – Chương trình tìm BCNN của 2 số là một bài tập cơ bản giúp các bạn sinh viên rèn luyện tư duy lập trình. Trong bài viết này, Nguyễn Văn Hiếu sẽ cùng các bạn đi tìm các phương pháp khác nhau để giải bài tập […]