Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Administrator
Public Cpp Test
Commits
2a291a73
Commit
2a291a73
authored
Oct 23, 2023
by
shengnan hu
Browse files
main
parents
Changes
638
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
384 additions
and
0 deletions
+384
-0
BM-GJB8114-2013/R-1-11-1/R-1-11-1-good.cpp
BM-GJB8114-2013/R-1-11-1/R-1-11-1-good.cpp
+15
-0
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.c
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.c
+13
-0
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.cpp
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.cpp
+13
-0
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.c
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.c
+13
-0
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.cpp
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.cpp
+13
-0
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.c
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.c
+17
-0
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.cpp
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.cpp
+17
-0
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.c
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.c
+17
-0
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.cpp
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.cpp
+17
-0
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.c
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.c
+13
-0
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.cpp
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.cpp
+13
-0
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.c
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.c
+21
-0
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.cpp
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.cpp
+21
-0
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.c
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.c
+22
-0
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.cpp
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.cpp
+22
-0
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.c
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.c
+22
-0
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.cpp
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.cpp
+22
-0
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.c
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.c
+31
-0
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.cpp
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.cpp
+31
-0
BM-GJB8114-2013/R-1-12-2/R-1-12-2-good.c
BM-GJB8114-2013/R-1-12-2/R-1-12-2-good.c
+31
-0
No files found.
BM-GJB8114-2013/R-1-11-1/R-1-11-1-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
;
float
x
,
y
,
z
;
z
=
0.0
;
x
=
z
;
//遵循1
if
(
0
==
i
)
//遵循2
{
y
=
z
;
//遵循3
}
return
(
0
);
}
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.c
0 → 100644
View file @
2a291a73
int
Gstatic
;
//违背1
int
main
(
void
)
{
static
int
StateN
;
//违背2
if
(
1
==
Gstatic
)
{
StateN
=
StateN
+
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-11-2/R-1-11-2-bad.cpp
0 → 100644
View file @
2a291a73
int
Gstatic
;
//违背1
int
main
(
void
)
{
static
int
StateN
;
//违背2
if
(
1
==
Gstatic
)
{
StateN
=
StateN
+
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.c
0 → 100644
View file @
2a291a73
int
Gstatic
=
0
;
//遵循1
int
main
(
void
)
{
static
int
StateN
=
0
;
//遵循2
if
(
1
==
Gstatic
)
{
StateN
=
StateN
+
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-11-2/R-1-11-2-good.cpp
0 → 100644
View file @
2a291a73
int
Gstatic
=
0
;
//遵循1
int
main
(
void
)
{
static
int
StateN
=
0
;
//遵循2
if
(
1
==
Gstatic
)
{
StateN
=
StateN
+
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.c
0 → 100644
View file @
2a291a73
struct
Spixel
{
unsigned
int
colour
;
struct
Scoords
{
unsigned
int
x
;
unsigned
int
y
;
}
coords
;
};
int
main
(
void
)
{
struct
Spixel
pixel
=
{
1
,
2
,
3
};
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-11-3/R-1-11-3-bad.cpp
0 → 100644
View file @
2a291a73
struct
Spixel
{
unsigned
int
colour
;
struct
Scoords
{
unsigned
int
x
;
unsigned
int
y
;
}
coords
;
};
int
main
(
void
)
{
struct
Spixel
pixel
=
{
1
,
2
,
3
};
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.c
0 → 100644
View file @
2a291a73
struct
Spixel
{
unsigned
int
colour
;
struct
Scoords
{
unsigned
int
x
;
unsigned
int
y
;
}
coords
;
};
int
main
(
void
)
{
struct
Spixel
pixel
=
{
1
,
{
2
,
3
}
};
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-11-3/R-1-11-3-good.cpp
0 → 100644
View file @
2a291a73
struct
Spixel
{
unsigned
int
colour
;
struct
Scoords
{
unsigned
int
x
;
unsigned
int
y
;
}
coords
;
};
int
main
(
void
)
{
struct
Spixel
pixel
=
{
1
,
{
2
,
3
}
};
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Etype
{
RED
,
WHITE
=
0
,
//违背1
BLUE
}
edata
;
edata
=
BLUE
;
return
(
0
);
}
BM-GJB8114-2013/R-1-11-4/R-1-11-4-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Etype
{
RED
,
WHITE
=
0
,
//违背1
BLUE
}
edata
;
edata
=
BLUE
;
return
(
0
);
}
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Etype1
{
RED
=
0
,
//遵循1
WHITE
,
BLUE
}
edata1
;
enum
Etype2
//遵循2
{
BLAKE
=
3
,
GREEN
=
4
,
YELLOW
=
5
}
edata2
;
edata1
=
BLUE
;
edata2
=
GREEN
;
return
(
0
);
}
BM-GJB8114-2013/R-1-11-4/R-1-11-4-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Etype1
{
RED
=
0
,
//遵循1
WHITE
,
BLUE
}
edata1
;
enum
Etype2
//遵循2
{
BLAKE
=
3
,
GREEN
=
4
,
YELLOW
=
5
}
edata2
;
edata1
=
BLUE
;
edata2
=
GREEN
;
return
(
0
);
}
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.c
0 → 100644
View file @
2a291a73
typedef
unsigned
int
bool
;
int
main
(
void
)
{
bool
outReg1
,
outReg2
;
int
r
=
0
,
h
=
500
,
flag
=
0
;
outReg1
=
(
r
>
100
);
outReg2
=
(
h
>
300
);
if
(
outReg1
>
outReg2
)
//违背1
{
flag
=
1
;
}
if
(
outReg1
<
outReg2
)
//违背2
{
flag
=
2
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-12-1/R-1-12-1-bad.cpp
0 → 100644
View file @
2a291a73
typedef
unsigned
int
bool
;
int
main
(
void
)
{
bool
outReg1
,
outReg2
;
int
r
=
0
,
h
=
500
,
flag
=
0
;
outReg1
=
(
r
>
100
);
outReg2
=
(
h
>
300
);
if
(
outReg1
>
outReg2
)
//违背1
{
flag
=
1
;
}
if
(
outReg1
<
outReg2
)
//违背2
{
flag
=
2
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.c
0 → 100644
View file @
2a291a73
typedef
unsigned
int
bool
;
int
main
(
void
)
{
bool
outReg1
,
outReg2
;
int
r
=
0
,
h
=
500
,
flag
=
0
;
outReg1
=
(
r
>
100
);
outReg2
=
(
h
>
300
);
if
(
outReg1
&&
(
!
outReg2
)
)
//遵循1
{
flag
=
1
;
}
if
(
(
!
outReg1
)
&&
outReg2
)
//遵循2
{
flag
=
2
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-12-1/R-1-12-1-good.cpp
0 → 100644
View file @
2a291a73
typedef
unsigned
int
bool
;
int
main
(
void
)
{
bool
outReg1
,
outReg2
;
int
r
=
0
,
h
=
500
,
flag
=
0
;
outReg1
=
(
r
>
100
);
outReg2
=
(
h
>
300
);
if
(
outReg1
&&
(
!
outReg2
)
)
//遵循1
{
flag
=
1
;
}
if
(
(
!
outReg1
)
&&
outReg2
)
//遵循2
{
flag
=
2
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.c
0 → 100644
View file @
2a291a73
int
fsub
(
int
*
a
,
int
*
b
);
int
main
(
void
)
{
int
sub
=
0
;
int
a
=
1
,
b
=
2
;
sub
=
fsub
(
&
a
,
&
b
);
return
(
0
);
}
int
fsub
(
int
*
a
,
int
*
b
)
{
int
sub
=
0
;
if
(
a
>
b
)
//违背1
{
sub
=
(
*
a
)
-
(
*
b
);
}
else
if
(
a
<
b
)
//违背2
{
sub
=
(
*
b
)
-
(
*
a
);
}
else
{
sub
=
0
;
}
return
sub
;
}
BM-GJB8114-2013/R-1-12-2/R-1-12-2-bad.cpp
0 → 100644
View file @
2a291a73
int
fsub
(
int
*
a
,
int
*
b
);
int
main
(
void
)
{
int
sub
=
0
;
int
a
=
1
,
b
=
2
;
sub
=
fsub
(
&
a
,
&
b
);
return
(
0
);
}
int
fsub
(
int
*
a
,
int
*
b
)
{
int
sub
=
0
;
if
(
a
>
b
)
//违背1
{
sub
=
(
*
a
)
-
(
*
b
);
}
else
if
(
a
<
b
)
//违背2
{
sub
=
(
*
b
)
-
(
*
a
);
}
else
{
sub
=
0
;
}
return
sub
;
}
BM-GJB8114-2013/R-1-12-2/R-1-12-2-good.c
0 → 100644
View file @
2a291a73
int
fsub
(
int
*
a
,
int
*
b
);
int
main
(
void
)
{
int
sub
=
0
;
int
a
=
1
,
b
=
2
;
sub
=
fsub
(
&
a
,
&
b
);
return
(
0
);
}
int
fsub
(
int
*
a
,
int
*
b
)
{
int
sub
=
0
;
if
(
(
*
a
)
>
(
*
b
)
)
//遵循1
{
sub
=
(
*
a
)
-
(
*
b
);
}
else
if
(
(
*
a
)
<
(
*
b
)
)
//遵循2
{
sub
=
(
*
b
)
-
(
*
a
);
}
else
{
sub
=
0
;
}
return
sub
;
}
Prev
1
…
4
5
6
7
8
9
10
11
12
…
32
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment