01 backpack problems, 01 backpack
1 // 01 backpack problem 2 # include 3 int w [20]; // weight 4 int p [20]; // value 5 int c [20]; // select 6 int bag; // backpack bearing 7 8 int select (int m, int B) 9 {10 // There are m items, the backpack can
C input buffer and redirection, C input buffer redirection
Input buffer:
First, let's look at a echo applet, which displays the characters entered by the user on the screen.
//echo.c#includeint main(){ int ch; while((ch=getchar())!=EOF) {
Hdu 2196 Computer tree DP, hdu2196
Link: http://acm.hdu.edu.cn/showproblem.php? Pid = 1, 2196
Start with a computer, and then add a N-1 computer (N
The maximum distance between each computer and other computers is required;
Train of Thought: after
IAR: Modify the project name, Tab key settings, and iartabIAR modify project name
Many times IAR development is based on existing engineering templates, but the name of the Engineering Template is often a headache. The following is a solution:
Copy
Talk C chestnuts together (125th back: C language instance -- display file name and row number)
Hello, everyone. The built-in macro example we mentioned in the previous review is as follows:Show file name and row number. When you leave the rest of
Network Shortest Path Dijkstra algorithm analysis
Recently I have been studying algorithms and have seen such an algorithm. I decided to extract it as my learning notes:
/** File: shortest. c * Description: the Dijkstra Algorithm * Shortest Path
[String processing algorithm] design of the algorithm for maximum consecutive characters and the number of occurrences and Implementation of C code
I. Requirement Description
Enter a string, write a program to find the longest consecutive character
Queue using non-cyclic two-way linked list in C Language
In the previous two blogs, I used static arrays and dynamic arrays to simulate cyclic queues. However, in a linear table, the most important thing in a queue is a linked list. I used a lot of
Large set of Win32 drawing messages and large set of win32 drawing messages
AbortPath discards all paths selected for a specified device scenario. Cancel creating any path currently in progressAngleArcDraw a line with a connection arcDraw an
Detailed description of KMP algorithm and kmp Algorithm
1/* The next array is the key to the KMP algorithm. The next array is used when the mode string T and the main string S do not match 2 *, the element corresponding to the next array guides
An integer. After 100 is added, it is a full vertex number, and 168 is a full vertex number. What is this number ?, 100168
Program Analysis: if the number is less than 0.1 million, add 100 to the number before the start, and then add 268 to the
Win32 inter-process communication-shared memory and win32 inter-process communication --
Please kindly advise if you have any mistakes!
Recently, I looked at win32 inter-process communication. Simple Writing: using shared memory for inter-process
C language to clear two-way non-circular linked list (no leading node)
In my previous blog "basic operations for implementing a single-chain table in C Language", I implemented how to clear a single-chain table. Now I have switched to a two-way non-
Delete linked list nodes in C Language
Adding, deleting, modifying, and querying linked list nodes is the most basic operation. This blog will delete nodes. For other operations, refer to the blog "basic operations for implementing linked lists in C
Insert linked list nodes in C Language
Adding, deleting, modifying, and querying a linked list are the most basic operations. In my previous blog "delete linked list nodes in C Language", I deleted a node in the linked list. Here we want to insert a
Pointer as function parameter, pointer function parameter
Demonstration Result 1:
Demonstration Result 2:
Sample Code:
# Include void swap (int *, int *); void swap1 (int *, int *); void function1 (void); void displayIntArray (int *, int ); void
Counts the number of input rows, number of words and characters, number of rows, and
Count the number of input lines, number of words, and number of characters
# Include # define IN 1/* IN the word */# define OUT 0/* OUT of the word * // count
Sizeof is both a keyword and an operator, but not a function !, Sizeof OperatorIs sizeof a keyword?
Sizeof is a keywordThis is beyond doubt. You cannot define sizeof as any identifier. View the instructions in the C language standard
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.