C++ Practice Problem – Calculate 1977!

C++ Practice Problem - Calculate 1977!

Time Limit: 2s Memory Limit: 192MB Problem Description Write a program to calculate the value of 1977! Input Format None Output Format None Sample Input None Sample Output None Code #include <iostream> using namespace std; const int MAX_DIGITS = 10000; // Estimate the number of digits in 1977! void factorial(int n) { int result[MAX_DIGITS] = … Read more

Learning C++ Programming from Scratch, Day 419: 1208 – Spiral Matrix; Problem Set Answers; Method 1

Learning C++ Programming from Scratch, Day 419: 1208 - Spiral Matrix; Problem Set Answers; Method 1

1208 – Spiral Matrix Spiral Matrix Program Development Approach The spiral matrix program is designed to generate and output a spiral-shaped numerical matrix. Below, I will explain the development approach of this program in detail to help beginners understand. Program Objective Create an n×n matrix where the numbers from 1 to n² are arranged in … Read more

CCF Programming Assessment · C++ · (Level 1 2025-06)

CCF Programming Assessment · C++ · (Level 1 2025-06)

C++ Level 1 C++ Level 2 C++ Level 3 C++ Level 4 C++ Level 5 C++ Level 6C++ Level 7C++ Level 8 CSP-JCSP-J Round 2 (2020) CSP-S 2025-12 Theory Programming 1.(Luogu:) Solution→ Sample Analysis: … Understanding the Problem: … Basic Knowledge: … Steps to Approach: … Code Implementation (C++): 2.(Luogu:) Solution→ Sample Analysis: … Understanding … Read more

C++ Practice Problem – Collatz Conjecture

C++ Practice Problem - Collatz Conjecture

Time Limit: 2s Memory Limit: 192MB Problem Description Collatz Conjecture: A Japanese middle school student discovered a fascinating “theorem” and asked Professor Kakutani to prove it, but the professor was unable to do so, leading to the Collatz conjecture. The conjecture states that for any natural number, if it is even, divide it by 2; … Read more

Differences Between Firmware and Software in Embedded Development

Differences Between Firmware and Software in Embedded Development

In embedded system development, “Firmware” and “Software” are two concepts that are closely related yet fundamentally different. They together constitute the operational logic of a device, but they have clear boundaries in terms of hardware dependency, functional positioning, and development models — firmware is the “soul of the hardware,” responsible for bringing the hardware “to … Read more

Exploring Pointers in C Language (Part 5) — Linked Lists: A Perfect Interpretation of Pointer Art

Exploring Pointers in C Language (Part 5) — Linked Lists: A Perfect Interpretation of Pointer Art

After a few busy days, I haven’t had the chance to focus on this topic. Today, on my business trip back to Beijing, I reflected on it and thought it was necessary to back up the linked list. 1. What is a Linked List? A linked list is a data structure composed of a series … Read more

Comprehensive Analysis of C++ Data Structures: 20 Core Implementation Solutions from Linked Lists to Graph Theory

Comprehensive Analysis of C++ Data Structures: 20 Core Implementation Solutions from Linked Lists to Graph Theory

1. Advanced Practice of Linear Data Structures 1.1 Deep Implementation of Linked List The linked list, as the most basic dynamic data structure, has a wide range of variants and application scenarios. Below is the complete implementation of a doubly linked list: #include <iostream> #include <memory> template<typename T> class Node { public: T data; std::unique_ptr<Node<T>> … Read more

C++ Practice Problem – Automorphic Numbers

C++ Practice Problem - Automorphic Numbers

Time Limit: 2s Memory Limit: 192MB Problem Description An automorphic number is a number whose square ends with the number itself. For example: 25^2=625 76^2=5776 9376^2=87909376 Find all automorphic numbers less than or equal to 200000. Input Format No input Output Format All automorphic numbers less than or equal to 200000 (including 0, numbers separated … Read more

C++ Practice Problem – The Hundred Money Hundred Chickens Problem

C++ Practice Problem - The Hundred Money Hundred Chickens Problem

Time Limit: 2s Memory Limit: 192MB Problem Description The famous “Hundred Money Hundred Chickens Problem” was proposed by the ancient Chinese mathematician Zhang Qiujian in his book “Mathematical Classics”: A rooster costs 5 coins, a hen costs 3 coins, and 3 chicks cost 1 coin. With 100 coins, how many roosters, hens, and chicks can … Read more

Day 13: Developing Programming Habits in 21 Days: C++ Problem Solving Day 13

Day 13: Developing Programming Habits in 21 Days: C++ Problem Solving Day 13

Learn programming with Lao Ma by “leveling up and fighting monsters”! Involves examination: Computer Society Programming Ability Level Certification (GESP) Event content: Provides real exam questions of different levels for students to practice Preparation advice: Choose corresponding questions based on your preparation level Additional value: Can be used as preparation training for whitelist competitions Day … Read more