1. fork[Cpp]# Include # Include Pid_t fork (void );
# Include # Include Pid_t fork (void); correct return: The process number of the child process returned by the parent process; 0 returned by the child processError returned:-1;A child process is a
No bit operations (&, |, ^, ,~), Implement a function to obtain the ninth digit of the int type (counting starts from the first digit)
[Cpp]Int check (){Union utype{Int I;Char c;};Utype u;U. I = 1;Return u. c = 1;} Int getbit (int val){Char * p
Question: Enter the root node of a binary tree to find the depth of the tree. A tree path is formed from the root node to the leaf node. The longest path length is the depth of the tree.
For example, input binary tree:
10/\6 14//\4 12 16
Output
Question: You are given two linked lists representing two non-negative numbers. the digits are stored in reverse order and each of their nodes contain a single digit. add the two numbers and return it as a linked list. input: (2-> 4-> 3) + (5-> 6-> 4
[Cpp]/*Copyright and version Declaration of the programCopyright (c) 2012, a student from the computer College of Yantai UniversityAll rightsreserved.File Name: object. cppAuthor: Liu QingyuanCompletion date: January 1, April 12, 2013Version:
Status compression DP... it's easy... A maximum of 10 rows... 1 represents the artillery .. 0 indicates not to put... A maximum of 1024 statuses can be found in each row .. and it must be legal .. this way .. A maximum of 60 statuses can be found in
[Cpp]// SalesManagementSystem. h: main header file for the SALESMANAGEMENTSYSTEM application// # If! Defined (afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _)# Define afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_
[Cpp]# Include # Include # Include Unsigned int hashTable [256];Char queue [256]; Char solve (char * str){Unsigned int I = 0;Memset (hashTable, 0, sizeof (hashTable ));Memset (queue, '0', sizeof (queue ));Int index = 0;For (I = 0; I {Int loc = (int)
/*
Query set processing =, and then sort the topology. When there are more than one element in the team, the conditions are insufficient. If the conditions are not used up, a conflict occurs.
*/
# Include
# Include # Include # Include Using
[Cpp]# Include # Include Char arrays [] = {'A', 'B', 'C', '\ 0 '};Char * s = "abc "; Void test (){// Arrays and s are equal. If arrays [] = {'A', 'B', 'C'}, they are not equal.If (strcmp (arrays, s) = 0)Printf ("arrays = s \ n ");Printf ("% d \ n",
Question:
Template void fun (T num ){};If you callFun (double (1.23 ));Fun (int (1 ));The compiler will enumerate fun (double num) and fun (int num)But I want to ask if you call fun (int) twice)Fun (int (1 ));Fun (int (2 ));The compiler will
Problem DescriptionXiaoou33 is particularly interested in both prime numbers and the number of input objects. For example, 151 is both a prime number and a background. Xiaoou333 wants you to help him find the prime number in a certain range. Please
Today, I will summarize some of the design patterns I have used. However, due to the small amount of data on the C ++ design patterns, I will stick to the C ++ language description.
First: Singleton
Very simple. If you have any questions,
Mobile phonesTime Limit: 5000 MS Memory Limit: 65536 KTotal Submissions: 12189 Accepted: 5590
Description
Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. the area is divided into squares. the
Question: There are many strings. Each string indicates that the object represented by the first letter of the string can be converted into an object represented by the last letter. The question is whether the 'B' object can be converted into a 'M'
The role of virtual functions in C ++ is to implement the polymorphism mechanism. With regard to polymorphism, in short, the pointer of the parent type points to the instance of its subclass, and then calls the member function of the actual subclass
Multiple backpacks that just fill up
During initialization, dp is initialized to infinity, while dp [0] = 0;
[Cpp]/* HDOJ1114Author: Chen jiairun2013-04-18*/# Include Using namespace std;# Define min (a, B) (a> B? B:)# Define INF 0x3f3f3fInt dp [
/*
Given a number n, where P (k) = n is satisfied, where k has a number of prime factors Euler's function:Phi (k) = k * (1-1/p1) (1-1/p2) (1-1/p3)= (P1-1) * p1 ^ x * (p2-1) * p2 ^ y * (p3-1) * p3 ^ z;Phi (1) = 1;Because n = phi (k), enumeration pi-
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