Home > Back-end >  Pray god taught how to change this?
Pray god taught how to change this?

Time:09-18

Supplement: modify the source code format, make it accord with "Google c + + style guide" # include # define N 8 main () {int a [N], I, thismax, maxsum; for(i=0; i
for(i=0; i Maxsum) maxsum=thismax; The else maxsum=maxsum; }}

CodePudding user response:

What the hell is the Google c + + style guide? Don't bird it,

CodePudding user response:

The code clear, format specification, good readability,

CodePudding user response:

The most common style is like this:
 
#include

8 # define N

Int main ()
{
Int a [N], I, thismax=0, maxsum=0;

for(i=0; i for(i=0; i {
Thismax=thismax + a, [I].
If (thismax & lt; 0)
{
Thismax=a [I + 1);
i=i + 1;
}
The else
If (thismax & gt; Maxsum) maxsum=thismax;
//else maxsum=maxsum;//this useless
}

return 0;//this can not
}

CodePudding user response:

refer to the second floor u010165006 response:
code is clear, format specification, good readability,


Direct use code formatting, is clear specification code ~ ~ ~

CodePudding user response:

reference 4 floor hongss response:
Quote: refer to the second floor u010165006 response:

The code clear, format specification, good readability,


Direct use code formatting, is clear specification code ~ ~ ~


But also pay attention to write their own specifications, such as indentation, not all by code formatting, variable, function name,
  • Related