long time did not write a little C + + program, after nothing more imitation STL, although not up to the standard STL program, but the simple function is to achieve. STL is really profound: generic programming, containers, algorithms, adapters ...
/*there is a fractional sequence: 2/1,3/2,5/3,8/5,13/8,21/13. Find the sum of the first 20 items of this series. */#includeintMainvoid){ intn,t,num= -; floatA=2, b=1, s=0; for(n=1; n) {s=s+a/b; T=A; A=a+b; b=t;/*This part is the key to the
classBase { Public: Virtual voidFintx);};classDerived: PublicBase { Public: Virtual voidFDouble*PD);};D Erived*PD =NewDERIVED;PD->f (Ten);//Error!The problem is that derived::f hides base::f, even if they take a different parameter type, so the
Keep blogging--be good at summarizing and documenting every day of studyToday, a simple review of the C + + standard IO library, C + + IO operation and C's IO operation principle is not the same, C + + is the use of a powerful class library to
In object-oriented programming, there are two completely different inheritance types: Implementation inheritance and interface inheritance.
Implement inheritance: indicates that a type is derived from a base type and has all member fields and
XPath can quickly locate nodes or attributes in XML. The XPath syntax is simple, but powerful enough. It is also the basic knowledge of using XSLT.
Example XML:
100 this is a black cat 80 this is a white cat 80 this is a
This is a backpack problem. In this case, each node on a K-sub-tree has its own K children. Then, the sum of the keys that walk from the origin to a certain point is n and the length of each entry is not less than D. pause and ask how many such
Ultraviolet A 11557-Code Theft (KMP + HASH)Ultraviolet A 11557-Code Theft
Question Link
Give some code text, and then find the existing text and the previous Code text given an existing text, repeat the text with the most consecutive lines
Train of
Uva103-Stacking Boxes (DAG)
Question: uva103-Stacking Boxes (DAG)
N boxes are given and the dimensions of these boxes are given. The longest sequence is required, this makes sure that the following box has a dimension sequence greater than that of
POJ 3667 Hotel)
Description
The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. bessie, ever the competent travel agent, has named the Bullmoose Hotel on famed
Poj1_9_layout (difference constraint)
Solution report
Question Portal
Ideas:
Simple difference Constraint
Solving max
N-1
Start from 1 and run the short circuit at n. The obtained dis [n] is the answer.
#include
#include
#include
C ++ implements web crawlerC ++ implements web crawler copy Code # include # include # include # include # include # include # include # include # include # include # include # pragma comment (lib, "ws2_32.lib") using namespace std; void
Ultraviolet A 501-Black Box (priority queue)
Link to the question: Ultraviolet A 501-Black Box
There is a set in which the given elements enter the order of the set. Now there are Q queries. Given that each query enters the set after the first few
Hdu 4974 mathematical miscellaneous/proof
Question model: n positive numbers. You can perform one of the following two operations each time:
1: Subtract one from each other.
2: Subtract one of the two numbers.
Make sure that the number of each
Hdu3366sequence operation line segment tree Solution
Question: Click to open the link
Analysis: the interval of the Line Segment tree is updated. It is only mixed with Range Sum, maximum continuous interval sum. The latency tag has already appeared
UV 10829-L-Gap Substrings (suffix array)Ultraviolet A 10829-L-Gap Substrings
Question Link
If a string is in the format of UGU and the length of G is L, the string is called L. If a string is given, ask the number of substrings of this string as
Ultraviolet-1478 Delta Wave (large number + catlan number)
Description
A delta wave is a high amplitude brain wave in humans with a frequency of 1-4 hertz which can be recorded with an electroencephalogram (EEG) and is usually associated with
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