In the first part, we learned how to serialize a simple object through the serialize () function of the CArchive class. Like the following program:
Int CFoo: serialize
(CArchive * pArchive)
{
Int nStatus = SUCCESS;
// Serialize the
The following code calculates the maximum common divisor and least common multiple of two positive integers, m and n:# Include Void main (){Int m, n, gcd, lcm;/gcd is the maximum common approx. lcm is the least common multiple/Int max, min,
In C, suppose we have a function like this:
Int function (int a, int B)
You can use this function by using result = function. However, when a high-level language is compiled into a machine code that can be recognized by a computer, a problem arises:
For a given 32-bit integer, write a function. If this number is positive, 1 is returned. If it is negative,-1 is returned, if it is set to zero, zero is returned, and no condition is required to judge the branch jump statement. Here, a slight
In 3D coordinates, point judgment is much more complicated. If google "Point in triangle" is the first search result on this webpage, it is a pity that the author did not discuss the result further and did not provide a good implementation, in
The meaning of this question is to give you n related points, represented by A-I, and then given n-1 rows, the I-th line represents the relevant information from vertex I to other points.Based on the given map, we need to select an appropriate route
To understand pointers, there may be more or less complex types. So I will first introduce how to fully understand a complex type. To understand complex types, there will be many operators in a type, they also have priorities, just like normal
1. Scope
The float and double ranges are determined by the number of digits of the index. (Because the representation is in the form of 1.x * 2 ^ Y, the result of 1. x is ignored, and the index is directly used to represent the range of floating
What if you want to use beautiful icons in other applications? Some icon extraction tools may be used! So, do you know how they are implemented, and do not want to create a suitable icon Extraction Tool by yourself? It extracts ICON resources from
Input two integers from the keyboard. the maximum and minimum public approx.
Method 1: Exhaustion# Include Main (){Int m, n, I;Scanf ("% d", & m, & n );For (I = m; I --)If (m % I = 0 & n % I = 0) break;Printf ("% d, % d", I, m * n/I );}--------------
# Include "stdafx. h"
# Include # Include
Using namespace std;
Class person {// declare the base classProtected:Int age;Char sex;String name;Public:Person (int a, char s, string nam ){Age =;Sex = s;Name = nam;}};Class teacher: virtual public person{
Section 1: A simple questions about virtual functionsQuestion requirement: Write the running result of the following program?View plaincopy to clipboardprint?# Include Using namespace std;Class{Public:Virtual void p (){Cout }};Class B: public{Public:
Find the minimum k countDescription: 5. Find the minimum k elements.Question: Enter n integers and output the smallest k integers.For example, if you enter the 8 numbers 1, 2, 3, 5, 6, 7, and 8, the minimum four digits are 1, 2, 3, and 4.
Section 1,
The struct contains different data types, and the data structure types occupy space. For example, the char type occupies 1 byte, and the short int type occupies 2 bytes, int, long int, pointer, float occupy 4 bytes, and double occupies 8 bytes (in
1.separate 1.txt content into three files (amount, ID card, code ).2. to ensure fairness in the game, write the code as a line (for some language features, directly calculate the size of the code file)3. The minimum number of codes indicates the
Obviously, the biggest matching question. In addition, the question is SPJ. You can use the Hungary algorithm to calculate the maximum number of matches from row to column.
My code:
Source Code
Problem: 1719 User: bingshenMemory: 1160 K Time: 16
I recently worked on a project that uses a encapsulated dynamic library (lib + dll). The header file defines the export type as: # ifdef NetLink# Define NETDIR _ declspec (dllexport)# Else# Define NETDIR _ declspec (dllimport)# Endif
NETDIR void
[Question ]:Calculate the first address of a struct object based on the address of a member.[Example ]:Struct{Int x;Int y;Int z;} # Define GET_HEADER_ADDR (MEMBER) (you can implement it) Void main (){Struct A myTest; Printf ("addr is % d",
Yesterday I tested how to use a function to apply for a space from the stack space of the Program for other functions.
Data Structure proposition: the knapsack problem.
The proposition is as follows:
View Code
/* 1. Problem description
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