Given a sequence, can only take D, next door will flip, ask can all take away.Notice that if you can take it, it's okay to take the order of D. Simulation can#include #include#include#include#includeusing namespacestd;#defineINF (0X3F3F3F3F)typedefLong Long intLL; #include#include#include#includeSet>#include#include#includestring>Const intMAXN = 1e5+ -;CharSTR[MAXN];CharSUB[MAXN];voidWork () {Charbook[ the]; book['B']='D'; book['D']='B'; intN; scanf ("%d",N); scanf ("%s", str+1); strcpy (Sub+1,
One, possible combinations:(1) Const CHAR*P(2) Char Const*p(3) Char *const p(4) const char **P(5) Char Const**p(6) Char *const *p(7) Char **const pOf course, in (5), (6), (7) and then insert a const in a number of cases, but the
I. Possible combinations:
(1) const char * P
(2) Char const * P
(3) char * const P(4) const char ** P
(5) Char const ** P
(6) char * const * P
(7) Char ** const P
Of cours
Zookeeper
Analysis of several cases with the const keyword
Const modified code
Meaning (features)
Equivalence
Int * P = num;
1. You can read yourself2. You can change yourself through * P.3. You can view other users through P = Data
Maximum Permissions
Cons int * P = num;
P * P P, * PZookeeper
Background Summary
I attended the group C ++ seminar last night, which involves many aspects, including this pointer, heavy-duty operator function, array pointer and pointer array, static member static, and so on. When we talk about the knowledge points of * P and
int *p = NULL;P: The address of the memory pointed to by the pointer p*p: The value of the memory address pointed to by the pointer pp: The address of the pointer p1 #ifndef _code_pointer_demo01_h_2 #define_code_pointer_demo01_h_3 4#include 5#include string.h>6#include 7 8 intMain () {9 Ten intA =Ten; One A
The basic template problem is to count the number of P occurrences in the numerator denominator, and then the inverse element is obtained.////main.cpp//fzu2020////Created by Chenga on 15/12/27.//Copyright (c) 2015 chenhuan001. All rights reserved.//#include#include#includestring.h>#includestring>#includeusing namespaceStd;typedefLong Longll;//ax + by = gcd (A, b)//incoming fixed value A, B. Put back D=GCD (A, B), X, yvoidEXTENDGCD (ll a,ll b,ll d,ll x
When const is used in conjunction with pointers, it is easy to confuse:1. Can the const limit the pointer to other memory?2. Is it forbidden to modify the contents of the block of memory it points to by this pointer? (PS: This is said to prohibit the use of this pointer to modify the memory block, so it is not impossible to modify, but to be modified by other means.) )Let's look at the underlying code first.Box.h Author:[email protected] #ifndef _box_h#define _box_hclass BOX {public:box (); int
Pointers often haunt us in C programming, but the flexibility to use pointers will make programming easier and more efficient. Here's the difference between *p[n], (*p) [N], and **p, and this is where I've often been troubled.The definitions of these three are:int *p[n] represents an array of pointers, which means that
Reprinted please indicate the source: http://blog.csdn.net/wingfiring
Some C/C ++ programming books once mentioned how to judge whether the pointer is null. obviously, if (P = NULL), if (P = 0), and if (p) can both complete this task. The difference lies in readability. we will discuss them separately.
1. If (P = NULL
When learning C language, pointer learning is a relatively difficult part, and it is often unable to distinguish * P P. The following is a test procedure for extracting others.Below is my short test programVoid test (){Int A = 8;Int * P = ;P = (int *) malloc (N * sizeof (INT ));// Printf ("% d/N", *
Why I run in the company is no problem, copy to my Computer, because my p used as a page value, so I each function in $p first error.
Reply to discussion (solution)
Please ask the landlord p = $p = = "? "1": $p; Do you think this is a ternary operation?
$
Tag: size operation has no increment operator precedence nbsp ext font New1. Understanding the self-increment decrement operator(1) post-increment-decrement operator precedence > pre-increment decrement operator. (2) The pre-increment-decrement operator "variable is first self-decrement and then used". (3) The post-increment-decrement operator "variable is first used for re-increment self-decrement". 2. The * operator and the pre-increment-decrement operator are all 3-level operators, but the pr
We installed in the mobile phone "every day p map" you will see on the home page has a "Crazy change makeup" start cos Wu Mei Niang, as shown in the following figure.
Then we open into the "crazy change makeup" Inside there are a lot of installed, such as queen makeup, Yangfei makeup, Weffei makeup, vampire makeup, such as a variety of 20 exquisite makeup can be selected.
After choosing a good module, we can choose our own photos, th
First of all, do not think this writing is not good, but also stressed that the great God generally do not write this code, readability is not highIn fact, your C language Foundation is too poor, read do not understand, the great God really is so written. You can look at some of the words in C library functions*p++: * and + + are sibling operators, right-associative. But + + to calculate the entire expression operation, first extract
In fact, this daily p figure inside the sage is a ready-made module, we just have to put their own photos and then select the module can be, specific as follows.
The sage makeup Play:
The first step: the mobile phone installed the latest version of every day p map, and then click Daily P Figure app open into the homepage, click Crazy Change Makeup.
Step
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.