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
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
344 additions
and
0 deletions
+344
-0
BM-GJB8114-2013/R-1-7-7/R-1-7-7-bad.cpp
BM-GJB8114-2013/R-1-7-7/R-1-7-7-bad.cpp
+25
-0
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.c
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.c
+24
-0
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.cpp
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.cpp
+24
-0
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.c
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.c
+25
-0
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.cpp
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.cpp
+25
-0
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.c
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.c
+26
-0
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.cpp
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.cpp
+28
-0
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.c
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.c
+23
-0
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.cpp
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.cpp
+23
-0
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.c
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.c
+14
-0
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.cpp
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.cpp
+14
-0
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.c
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.c
+10
-0
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.cpp
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.cpp
+10
-0
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.c
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.c
+10
-0
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.cpp
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.cpp
+10
-0
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.c
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.c
+8
-0
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.cpp
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.cpp
+8
-0
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.c
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.c
+13
-0
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.cpp
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.cpp
+13
-0
BM-GJB8114-2013/R-1-9-2/R-1-9-2-bad.c
BM-GJB8114-2013/R-1-9-2/R-1-9-2-bad.c
+11
-0
No files found.
BM-GJB8114-2013/R-1-7-7/R-1-7-7-bad.cpp
0 → 100644
View file @
2a291a73
int
fun
(
int
a
,
int
*
b
);
int
main
(
void
)
{
int
i
=
1
,
j
=
2
;
int
k
;
k
=
fun
(
i
,
&
j
);
return
(
0
);
}
int
fun
(
int
a
,
int
*
b
)
{
if
(
1
==
a
)
{
*
b
=
*
b
+
a
;
return
(
1
);
}
else
{
*
b
=
*
b
-
a
;
}
//违背1
}
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.c
0 → 100644
View file @
2a291a73
void
fun
(
int
a
,
int
*
b
);
int
main
(
void
)
{
int
i
=
1
,
j
=
2
;
fun
(
i
,
&
j
);
return
(
0
);
}
void
fun
(
int
a
,
int
*
b
)
{
if
(
0
==
a
)
{
*
b
=
*
b
+
a
;
}
else
{
*
b
=
*
b
-
a
;
}
return
(
a
+
1
);
//违背1
}
BM-GJB8114-2013/R-1-7-8/R-1-7-8-bad.cpp
0 → 100644
View file @
2a291a73
void
fun
(
int
a
,
int
*
b
);
int
main
(
void
)
{
int
i
=
1
,
j
=
2
;
fun
(
i
,
&
j
);
return
(
0
);
}
void
fun
(
int
a
,
int
*
b
)
{
if
(
0
==
a
)
{
*
b
=
*
b
+
a
;
}
else
{
*
b
=
*
b
-
a
;
}
return
(
a
+
1
);
//违背1
}
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.c
0 → 100644
View file @
2a291a73
int
fun
(
int
a
,
int
*
b
);
int
main
(
void
)
{
int
i
=
1
,
j
=
2
;
int
k
;
k
=
fun
(
i
,
&
j
);
return
(
0
);
}
int
fun
(
int
a
,
int
*
b
)
{
if
(
1
==
a
)
{
*
b
=
*
b
+
a
;
}
else
{
*
b
=
*
b
-
a
;
}
return
;
//违背1
}
BM-GJB8114-2013/R-1-7-9/R-1-7-9-bad.cpp
0 → 100644
View file @
2a291a73
int
fun
(
int
a
,
int
*
b
);
int
main
(
void
)
{
int
i
=
1
,
j
=
2
;
int
k
;
k
=
fun
(
i
,
&
j
);
return
(
0
);
}
int
fun
(
int
a
,
int
*
b
)
{
if
(
1
==
a
)
{
*
b
=
*
b
+
a
;
}
else
{
*
b
=
*
b
-
a
;
}
return
;
//违背1
}
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
local
=
0
;
int
para
=
0
;
//...
switch
(
para
)
{
local
=
para
;
//违背1
case
1
:
//...
break
;
case
2
:
//...
break
;
default:
//...
break
;
}
return
local
;
para
++
;
//违背2
}
BM-GJB8114-2013/R-1-8-1/R-1-8-1-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
local
=
0
;
int
para
=
0
;
//...
switch
(
para
)
{
local
=
para
;
//违背1
case
1
:
//...
break
;
case
2
:
//...
break
;
default:
//...
break
;
}
return
local
;
para
++
;
//违背2
}
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
int
local
=
0
;
unsigned
int
para
=
0
;
//...
if
(
local
>=
0
)
{
para
=
1
;
}
else
//违背1
{
para
=
2
;
}
if
(
1
==
para
)
{
//...
}
return
(
0
);
}
BM-GJB8114-2013/R-1-8-2/R-1-8-2-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
int
local
=
0
;
unsigned
int
para
=
0
;
//...
if
(
local
>=
0
)
{
para
=
1
;
}
else
//违背1
{
para
=
2
;
}
if
(
1
==
para
)
{
//...
}
return
(
0
);
}
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
int
local
=
0
;
unsigned
int
para
=
0
;
//...
local
;
//违背1
para
-
0
;
//违背2
local
==
para
;
//违背3
local
>
para
;
//违背4
return
(
0
);
}
BM-GJB8114-2013/R-1-8-3/R-1-8-3-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
int
local
=
0
;
unsigned
int
para
=
0
;
//...
local
;
//违背1
para
-
0
;
//违背2
local
==
para
;
//违背3
local
>
para
;
//违背4
return
(
0
);
}
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
code
[
3
];
code
[
0
]
=
109
;
code
[
1
]
=
100
;
code
[
2
]
=
011
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-8-4/R-1-8-4-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
code
[
3
];
code
[
0
]
=
109
;
code
[
1
]
=
100
;
code
[
2
]
=
011
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
code
[
3
];
code
[
0
]
=
109
;
code
[
1
]
=
100
;
code
[
2
]
=
011
;
/* octal */
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-8-4/R-1-8-4-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
code
[
3
];
code
[
0
]
=
109
;
code
[
1
]
=
100
;
code
[
2
]
=
011
;
/* octal */
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.c
0 → 100644
View file @
2a291a73
unsigned
int
ucV1
=
0U
;
//遵循
unsigned
int
ucV2
=
0u
;
//违背
long
lV1
=
0L
;
//遵循
long
lV2
=
0l
;
//违背
float
fV1
=
0
.
0
F
;
//遵循
float
fV2
=
0
.
0
f
;
//违背
double
ldV1
=
0
.
0L
;
//遵循
double
ldV2
=
0
.
0l
;
//违背
BM-GJB8114-2013/R-1-8-5/R-1-8-5-bad.cpp
0 → 100644
View file @
2a291a73
unsigned
int
ucV1
=
0U
;
//遵循
unsigned
int
ucV2
=
0u
;
//违背
long
lV1
=
0L
;
//遵循
long
lV2
=
0l
;
//违背
float
fV1
=
0.0
F
;
//遵循
float
fV2
=
0.0
f
;
//违背
double
ldV1
=
0.0
L
;
//遵循
double
ldV2
=
0.0
l
;
//违背
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.c
0 → 100644
View file @
2a291a73
unsigned
int
Ginum
=
0
;
int
main
(
void
)
{
int
i
=
10
;
for
(
Ginum
=
0
;
Ginum
<
10
;
Ginum
++
)
//违背1
{
i
=
i
-
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-9-1/R-1-9-1-bad.cpp
0 → 100644
View file @
2a291a73
unsigned
int
Ginum
=
0
;
int
main
(
void
)
{
int
i
=
10
;
for
(
Ginum
=
0
;
Ginum
<
10
;
Ginum
++
)
//违背1
{
i
=
i
-
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-9-2/R-1-9-2-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
float
f
=
0
.
0
,
g
=
1
.
0
;
for
(
f
=
0
.
0
;
f
<
10
.
0
;
f
=
f
+
1
.
0
)
//违背1
{
g
=
f
+
g
;
}
return
(
0
);
}
Prev
1
…
17
18
19
20
21
22
23
24
25
…
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