On that day, the instructor gave a question and asked us to do it without recursion or loop ~ Sum of 100?
I wrote a code and sent it out today to see if you have any other good methods! I hope I can leave a message in a good way ,,,
The Code is as
It is found that file operations are always required for recently written programs, so review the functions related to the C language and file input and output.
C language is used to associate a file type pointer with a file to open, close,
3. IP address, structure, and data arrangementThe following section determines that we need to change it.
First, let's not talk about the code! First, let's talk about IP addresses and ports. Of course, we will talk about how to store and maintain
Generally, all we encounter is a small-end scenario. A typical X86 processor is a small-end scenario. However, many powerpc processors can be configured in the big-end mode or small-end mode. Therefore, the previous code is often run well, to the
Gcc-o hello-c hello. c Appears: Warning: no newline at end of file Solution: Add a carriage return at the end of the *. c file and separate it into one line. (Knock an empty line at the end of the program code, that is, press a enter key after the
I. Development Process of advanced language programs1. analyze the problem and create a model2. Presentation Model3. Edit the source program4. Program compilation (or translation) and linkThe program written in advanced languages is called the
Today, when I read the code, I found a structure similar to the following:
Switch (error)
{
Case ENUM_0:
Case ENUM_1:
Printf ("case 0 and 1 \ n ");
Case ENUM_2:
Printf ("case 2 \ n ");
Break;
}
If the error value is ENUM_0 or ENUM_1, printf ("case 0
1. Conversion specifiers% A (% A) floating point number, hexadecimal number, and p-(P-) Notation (C99)% C characters% D signed decimal integer% F floating point number (including float and doulbe)% E (% E) floating point number index output [e-(E-)
We use tolua ++ to manually bind the c/c ++ interface to lua. In the bound interface implementation, we need to retrieve the input parameters. Tolua ++ provides a series of tolua_toxxx functions, such:
Lua_Number tolua_tonumber (lua_State * L, int
Given a tree with n nodes, the remaining branches after deleting a node will certainly have the maximum number of nodes, and the minimum value of the maximum number of branch nodes for all nodes is obtained.
Solution: Tree DP. the first deep search
When defining classes in Objective-c, you can also use public and private variables similar to C ++ to modify member variables, as shown below:
[Cpp]@ Intterface Test: NSObject { @ PublicInt I;Int j; @ ProtectedFloat m;Float n; @ PrivateDouble
This is a very common example to implement the exchange of two data a and B. The value of a is given to B and the value of B is given to a. The general practice is to use the intermediate variable cache for exchange. The implementation method is as
Suddenly I want to try the object-c Write Program and put it in ios. So I found the object-c environment on the Internet. The GNUstep platform and gcc are used for cross-compilation. The basic components of GNUstop are as follows: gnustep-make
Two-dimensional array: int a [3] [4] = {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 8, 7, 6 }}; pointer array: int * pa [4]; Note: 1. the pointer array is actually an array, but the elements in the array are pointers, in this example, arrays are stored in pa [0],
/* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)* Copyright and version Declaration of the program* All rights
(1) OverviewA binary tree is a widely used data structure. However, regular insertion may result in an excessively high height and an imbalance of the entire tree. The red-black tree is a balanced binary tree. The set, map, and the internal data
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service