Bài toán Tháp Hà Nội là một trò chơi toán học cổ điển được đặt theo tên của thành phố Hà Nội, Việt Nam. Bài toán bao gồm ba cọc và một số đĩa có kích thước khác nhau, được xếp chồng lên nhau trong cọc đầu tiên, nhỏ nhất ở trên cùng. Mục tiêu […]
#bài tập c++
Cách giải phương trình bậc 2 trong C/C++
Cách giải phương trình bậc 2 thì chúng ta đã được học ở lớp dưới rồi phải không nào ? Vậy giải phương trình bậc 2 trong C/C++ thì sẽ như thế nào ? Hôm nay chúng ta sẽ cùng tìm hiểu. Cách giải phương trình bậc 2 […]
Bài 40. Cách tính số Fibonacci trong C/C++
Chắc các bạn cũng đã biết dãy Fibonacci là gì rồi. Đó là dãy số mà số tiếp theo là tổng của hai số liền trước, ví dụ: 1, 1, 2, 3, 5, 8, 13, …. Bài viết này sẽ hướng dẫn cho các bạn cách tính số fibonacci bằng phương pháp dùng đệ quy […]
Cách tính thứ khi biết ngày tháng năm C/C++
Cách tính thứ khi biết ngày tháng năm như nào? Bạn có biết bằng cách nào các ứng dụng lịch có thể xác định thứ của các ngày từ quá khứ tới tương lai tít tắp như vậy không? Bởi vì chúng ta có thể tính toán được việc đó. Bây giờ bạn có một […]
Cách bắt sự kiện bàn phím trong C/C++
Có những cách bắt sự kiện bàn phím nào trong ngôn ngữ lập trình C/C++? Bạn muốn khi nhấn phím ESC thì thoát chương trình? Hay bạn muốn sử dụng các phím mũi tên để điều khiển trò chơi của mình? Bạn muốn khi nhấn phím nào đó thì chương trình sẽ thực hiện một […]