C++ Practice Problem – ‘Narcissistic Number’ Problem 2

C++ Practice Problem - 'Narcissistic Number' Problem 2

Time Limit: 2s Memory Limit: 192MB Problem Description Output all “Narcissistic Numbers”. A “Narcissistic Number” is a three-digit number such that the sum of the cubes of its digits equals the number itself. For example: 371 is a “Narcissistic Number” because 371 = 3^3 + 7^3 + 1^3. Input Format None Output Format Output all … Read more

C++ Programming for Kids (18) Bitwise Operations

C++ Programming for Kids (18) Bitwise Operations

One Overview of Bitwise Operations Bitwise operations are operations that directly manipulate the binary bits in memory, and are commonly used in low-level programming and high-performance computing. C++ provides six bitwise operators: <span><span>&</span></span> : Bitwise AND (AND operation) <span><span>|</span></span> : Bitwise OR (OR operation) <span><span>^</span></span> : Bitwise XOR (XOR operation) <span><span>~</span></span> : Bitwise NOT (NOT … Read more

Summary of C++ Programming Preliminary Questions for the 2025 Information Literacy Competition for Elementary School Students

Summary of C++ Programming Preliminary Questions for the 2025 Information Literacy Competition for Elementary School Students

2025 Youth Information Literacy Competition Algorithm Creativity C++ 1. 【Multiple Choice Questions】 (5 points each) Question 1 In C++, which symbol represents the logical operator “or”? A. || B. & C. == D. @ Question 2 What is the output of the following code when the input is 3? ( ) A. -n B. 0 … Read more

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

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

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

C++ Practice Problem – ‘Narcissistic Number’ Problem 1

C++ Practice Problem - 'Narcissistic Number' Problem 1

Time Limit: 2s Memory Limit: 192MB Problem Description Determine whether a number is a “Narcissistic number”. A “Narcissistic number” is defined as a three-digit number where the sum of the cubes of its digits equals the number itself. For example: 371 is a “Narcissistic number” because 371 = 3^3 + 7^3 + 1^3. Input Format … Read more

Understanding Linked Lists (C Language Implementation)

Understanding Linked Lists (C Language Implementation)

Understanding Linked Lists (C Language Implementation) 1. Basic Concepts of Linked Lists Linked List is a dynamic data structure composed of a series of nodes (Node), where each node contains: Data Field: stores the actual data Pointer Field: stores the memory address of the next node 2. Comparison of Linked Lists and Arrays Characteristics Array … Read more

Optimal Transport (OT) Algorithms in Python: Comprehensive Coverage from Theory to Application

Optimal Transport (OT) Algorithms in Python: Comprehensive Coverage from Theory to Application

Optimal Transport (OT) Algorithms in Python: Comprehensive Coverage from Theory to Application The optimal transport algorithm is becoming a new cornerstone in the field of machine learning, from image matching to gene alignment. In today’s artificial intelligence landscape, the theory of Optimal Transport (OT) is quietly sparking an algorithmic revolution. From image matching in computer … Read more

HPX High-Performance Parallel Programming 2: C++ Standard Library

HPX High-Performance Parallel Programming 2: C++ Standard Library

2 C++ Standard Library 2.1 Overview of the C++ Standard Library The above image outlines some components of the C++ Standard Library (SL), including algorithms, iterators, atomic operations, ranges, coroutines, input/output, thread support, and containers. It is important to note that most components are provided by the C++17 standard, with two provided by the C++20 … Read more

Computer Level 2 – C Language – Multiple Choice Question Training – 5

Computer Level 2 - C Language - Multiple Choice Question Training - 5

01 Answer: B Analysis: For option A: Different storage structures lead to different data processing efficiencies. For option B: The time complexity of an algorithm measures the time required for execution on a computer, while space complexity measures the storage space required during execution; the two are not necessarily related. For option C: The logical … Read more

2025 16th Blue Bridge Cup Provincial C++ Preliminary Exam Questions

2025 16th Blue Bridge Cup Provincial C++ Preliminary Exam Questions

1. Multiple Choice Questions Question 1 Problem: Run the following program, the output result is () . Code: int func(int y){y -= 5;cout &lt;&lt;"x";return 0;}int main(){int x=10,y=5;if(x&gt;y || func(y))cout&lt;&lt; y;return 0;} A. XO B. X5 C. 5 D. 0 Question 2 Problem: Run the following program, the output result is () . Code: int i=1,t=0;while(i … Read more