1 /*2 3 1.if4 Enter a score to rank5 6 Enter a number to determine if the number of daffodils7 for example 153 = 1 * 1 * 1 + 5 * 5 * 5 + 3 * 3 * 38 2, switch prompts the number to do the first processing and then use switch9 Score 60 points below
cout is an output stream object in C + + , which is defined in the header file iostream header file. (The stream object can be regarded as the information flow inside the computer, can carry the message inside the computer flow ), usage:cout" The
The difference between struct and class
The difference between struct and class in C: struct is only a struct defined by a complex data type, and cannot be used for object-oriented programming; C language has no class keyword.
The
Algorithm header file:#include#include
Algorithm Introduction: The STL algorithm uses the overlay mode rather than the placement mode, so the caller must ensure that there is sufficient space for the operation.
function Object Type declaration:
Standard C time and date functions1, Asctime (): Time Text Format#include Char *asctime (const struct TM *ptr);2. Clock (): Returns the elapsed time since the program started running#include clock_t clock (void);3. Ctime (): Returns a specific
Self-use specifications, reference from Google, Huawei and Microsoft.————————————————————————————Proper use of header files can make your code significantly more readable, file size, and performance.
#define的保护All header files should use #
ArrayArrays are first seen in C #. is stored continuously in memory, so its index is very fast, and the assignment and modification elements are simple.1 //Array2 string[] s=New string[2];3 //Assign Value4s[0]="a";5s[1]="b";6
Remember:For anything other than the built-in type, the initialization responsibility falls on the constructor, ensuring that each constructor initializes each member of the object.C + + stipulates that the initialization action of a member variable
#include #include//This header file needs to be preceded by Windows.h#include #includestring>#include#pragmaComment (lib, "Ws2_32.lib")using namespacestd;voidGetIP () {wsadata wsadata; //the WSADATA structure is used to store the Windows Sockets
Remember:To prevent the compiler from secretly providing functionality, the corresponding member function can be declared as privae and not implemented. You can also use a parent class such as uncopyable to implement it.For a unique object, you do
---restore content starts---Array---restore content starts---format Control characters :%x: Output or read in 16 binary form;%u: Unsigned output or read-inCin cout and scanf printf, a program do not mix the two;operators : Assignment operators,
An array in a function1.Char* Getmem () { char"HelloWorld"; p[50x0; return p;}P is an array, which is a local variable that shows that the values in the P array are destroyed after the function is executed.If p is used alone, p represents
One: StackStacks and queues are also linear structures, and the data elements for linear tables, stacks, and queues are the same as those of the data elements of the three structure, and the difference is that the operation of the linear table is
C # inheritance and derivation inheritanceA class can derive from more than one class or interface, which means that it can inherit data and functions from multiple base classes or interfaces.
Variables identified by protected are used only
In many cases, the applications we write need to provide an informational description or a sign function, hoping to use Httpserver to publish a simple website function, but do not want to rack a bloated HTTP server function,At this point, the
In the AOP programming concept, a common example is intercepting an object and logging the log before and after a method of the object executes.The most common way to intercept is to use the dynamic proxy class, which encapsulates a log interceptor
C#strings (String)In C #, you can use character arrays to represent strings, but it is more common to use the string keyword to declare a string variable. The string keyword is an alias for the System.String class.Properties of the 1.String classThe
Recursion: It is itself that calls itself.1 ///ask: To find the factorial of a number2 Static intFactor (intnum)3 {4 if(num==1)//decide when to start returning5 {6 returnnum;7 }8
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