Thoughts on two wonderful C Language Programs
#include
#include
void main(int i) { printf(%d, i); (&main + (&exit - &main)*(i/1000))(i+1);}
This involves the investigation of function pointers, recursion, C program
Subsequence with longest monotonic increasing
Subsequence with longest monotonic increasing
Question: design an O (n ^ 2) complexity algorithm to find the longest monotonic increasing subsequence of a sequence composed of n numbers.
Import java.
Poj 2409 Let it Bead Polya count
Rotation can be divided into n replicas. The corresponding equivalence classes are gcd (n, I) I = 0, and n replicas exist.
The flip is divided into parity discussions. There are n replicas in an odd number, each of
Sha 1555 Garland
There are n lanterns, the first is A, and the last is B. The relationship between the lanterns is given, and the height of Each Lantern is required to be non-negative. The lowest is B.
Idea: The formula H [I] = 2 * H [I-1] + 2-H
Quick learning C language 1: Hello WorldIt is estimated that students who do not write the C language have also heard the C language. Learn it from the beginning quickly, and they will certainly be able to use it in the future. If you have used
IOS Development Series-construction type of c language, ios development-c ConstructionOverview
In the first section, we mentioned the construction type of C language, which can be divided into arrays, struct, enumeration, and shared bodies. Of
Code for sorting strings (C)
Question: enter a string to print all the characters in the string.
Method: use recursion to switch positions sequentially and print the output.
Code:
/* * main.cpp * * Created on: 2014.6.12 * Author: Spike
Minimum k number code (C)
Question: Enter n Integers to find the minimum k number.
UseQuick Sort)To solve the problemIndex)Number of forward k.
Code:
/** Main. cpp ** Created on: 2014.6.12 * Author: Spike * // * eclipse cdt, gcc 4.8.1 */#
It is to determine whether a number is a prime number. There are many versions on the Internet, and I think it is a bit of a problem. Today, a friend asked me this question and I know it. Now I am posting my own code, very useful !!
# Include
# Include
#include
char data_file[]="D:\\%\\datetime.dat";
void get_data(void)
{
FILE *fp;
time_t t;
if((fp = fopen(data_file,"r")) == NULL)
Printf ("this program runs for the first time! \ N ");
else {
1/* 2 * Main. c 3 * B7-branch-07. compare 4 * Created on: June 16, 2014 5 * Author: Boomkeeper 6 */7 8 # include 9 10 int main () 11 {12 int a, B, c, * temp; 13 int * pa = & a, * pb = & B, * pc = & c; 14 15 scanf ("% I", pa, pb, pc); 16 if (* pa> *
A pointer is a type of data in C, similar to other types in C, such as int and char. Since the pointer is a type, when we define this type variable, this type variable is called a pointer variable.
C has a pointer and points to it. Point: the
Difference between memset and NULL
Difference between NULL and 0
Why does a malloc correspond to a free
In a structure malloc, and then free, but her member variable malloc is not free, and special free is required.
In the pointer Declaration of
Summarize the server-related content for several years through the server solution.The main body of the implementation is the lua script. The lua implementation mainly lacks two major parts:1. Network2. DatabaseThese two parts must be extended
Recently, when compiling an ARM program of DM8168, some errors such as undefined and redefinition are often reported. Due to the large number of source code files and many inclusion relationships, it is easy to mess up when you add your own programs.
Single-chain table
1. Link Storage Method
A linear table stored by link is called a Linked List ).
The storage of the linked list is as follows:
① Use a group of arbitrary storage units to store the nodes of a linear table (this group of storage
Description:
Enter a binary search tree and convert it into a sorted two-way linked list. It is required that no new node can be created, and only the point of the node pointer in the tree can be adjusted.
Input:
The input may
Description:
Enter a string and print all characters in the string in lexicographically. For example, if abc is input, all the strings abc, acb, bac, bca, cab, and CBA that can be arranged by characters a, B, and c are printed.
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.