🌈 style:

This commit is contained in:
lzy
2024-05-26 15:39:14 +08:00
parent 6f28a3384a
commit a57bbdb4c1
156 changed files with 765 additions and 770 deletions

View File

@@ -253,7 +253,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 120 PenaltyReturnTypeOnItsOwnLine: 120
# 指针和引用的对齐: Left, Right, Middle # 指针和引用的对齐: Left, Right, Middle
PointerAlignment: Right PointerAlignment: Left
# 允许重新排版注释 # 允许重新排版注释
ReflowComments: true ReflowComments: true
@@ -290,7 +290,7 @@ SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false SpaceBeforeSquareBrackets: false
# 在空的圆括号中添加空格 # 在空的圆括号中添加空格
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: true
# 在尾随的评论前添加的空格数(只适用于//) # 在尾随的评论前添加的空格数(只适用于//)
SpacesBeforeTrailingComments: 3 SpacesBeforeTrailingComments: 3

View File

@@ -1,6 +1,6 @@
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <string.h> #include <string.h>
int main( ) int main( )

View File

@@ -1,6 +1,6 @@
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
int main( ) int main( )
{ {

View File

@@ -25,8 +25,7 @@ int main()
// printf("[%s:%d]before while().", __FUNCTION__, __LINE__); // printf("[%s:%d]before while().", __FUNCTION__, __LINE__);
printf("[%s:%d]before while().\n", __FUNCTION__, __LINE__); printf("[%s:%d]before while().\n", __FUNCTION__, __LINE__);
while (1) while (1)
{ {}
}
// printf("[%s:%d]after while().", __FUNCTION__, __LINE__); // printf("[%s:%d]after while().", __FUNCTION__, __LINE__);
printf("[%s:%d]after while().\n", __FUNCTION__, __LINE__); printf("[%s:%d]after while().\n", __FUNCTION__, __LINE__);
// printf("f = %8.1f\n", f); // printf("f = %8.1f\n", f);

View File

@@ -1,6 +1,6 @@
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h>
#define WEIGHT 3.0e-23 #define WEIGHT 3.0e-23
#define KQ 950 #define KQ 950

View File

@@ -10,17 +10,11 @@ int main()
switch (ch) switch (ch)
{ {
case 'a': case 'a':
case 'A': case 'A': printf("Ant\n"); break;
printf("Ant\n");
break;
case 'b': case 'b':
case 'B': case 'B': printf("Butterfly\n"); break;
printf("Butterfly\n");
break;
case 'c': case 'c':
case 'C': case 'C': printf("Cobra\n"); break;
printf("Cobra\n");
break;
default: default:
printf("Input error"); printf("Input error");
// break; // break;

View File

@@ -7,7 +7,8 @@ void print_arr(int *p, int size)
printf("%s:%d\n", __FUNCTION__, sizeof(p)); printf("%s:%d\n", __FUNCTION__, sizeof(p));
// out: 8 指针 // out: 8 指针
for (i = 0; i < size; i++) printf("%d ", *(p + i)); for (i = 0; i < size; i++)
printf("%d ", *(p + i));
printf("\n"); printf("\n");
} }

View File

@@ -9,7 +9,8 @@ int main(int argc, char *argv[])
// for (int i = 0; i < argc; i++) puts(argv[i]); // for (int i = 0; i < argc; i++) puts(argv[i]);
for (int i = 0; argv[i] != NULL; i++) puts(argv[i]); for (int i = 0; argv[i] != NULL; i++)
puts(argv[i]);
// printf("Hello!\n"); // printf("Hello!\n");