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
492 additions
and
0 deletions
+492
-0
BM-GJB8114-2013/R-1-3-7/R-1-3-7-bad.cpp
BM-GJB8114-2013/R-1-3-7/R-1-3-7-bad.cpp
+22
-0
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.c
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.c
+22
-0
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.cpp
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.cpp
+22
-0
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.c
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.c
+10
-0
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.cpp
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.cpp
+10
-0
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.c
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.c
+18
-0
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.cpp
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.cpp
+18
-0
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.c
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.c
+18
-0
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.cpp
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.cpp
+18
-0
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.c
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.c
+18
-0
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.cpp
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.cpp
+18
-0
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.c
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.c
+23
-0
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.cpp
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.cpp
+23
-0
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.c
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.c
+27
-0
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.cpp
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.cpp
+27
-0
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.c
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.c
+46
-0
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.cpp
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.cpp
+46
-0
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.c
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.c
+48
-0
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.cpp
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.cpp
+48
-0
BM-GJB8114-2013/R-1-4-3/R-1-4-3-bad.c
BM-GJB8114-2013/R-1-4-3/R-1-4-3-bad.c
+10
-0
No files found.
BM-GJB8114-2013/R-1-3-7/R-1-3-7-bad.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
;
//违背1
//...
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.c
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
NULL
;
//遵循1
//...
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-7/R-1-3-7-good.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
NULL
;
//遵循1
//...
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.c
0 → 100644
View file @
2a291a73
#include <malloc.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
*
x
=
1
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-3-8/R-1-3-8-bad.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
*
x
=
1
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.c
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
//遵循1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-8/R-1-3-8-good.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
//遵循1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.c
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
x
!=
0
)
//违背1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-9/R-1-3-9-bad.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
x
!=
0
)
//违背1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.c
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
//遵循1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-3-9/R-1-3-9-good.cpp
0 → 100644
View file @
2a291a73
#include <malloc.h>
#include <stdlib.h>
int
main
(
void
)
{
int
*
x
=
(
int
*
)
malloc
(
sizeof
(
int
)
);
if
(
NULL
!=
x
)
//遵循1
{
*
x
=
1
;
}
else
{
return
(
-
1
);
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
double
x
=
0
.
0
;
//..
if
(
0
==
i
)
{
x
=
1
.
0
;
}
else
if
(
1
==
i
)
{
x
=
2
.
0
;
}
//违背1
if
(
0
==
j
)
{
x
=
x
+
5
.
0
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-1/R-1-4-1-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
double
x
=
0.0
;
//..
if
(
0
==
i
)
{
x
=
1.0
;
}
else
if
(
1
==
i
)
{
x
=
2.0
;
}
//违背1
if
(
0
==
j
)
{
x
=
x
+
5.0
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
double
x
=
0
.
0
;
//..
if
(
0
==
i
)
{
x
=
1
.
0
;
}
else
if
(
1
==
i
)
{
x
=
2
.
0
;
}
else
//遵循1
{
x
=
0
.
0
;
}
if
(
0
==
j
)
{
x
=
x
+
5
.
0
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-1/R-1-4-1-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
double
x
=
0.0
;
//..
if
(
0
==
i
)
{
x
=
1.0
;
}
else
if
(
1
==
i
)
{
x
=
2.0
;
}
else
//遵循1
{
x
=
0.0
;
}
if
(
0
==
j
)
{
x
=
x
+
5.0
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
,
k
=
0
;
double
x
=
0
.
0
;
//..
if
(
0
==
i
)
{
x
=
1
.
0
;
}
else
if
(
1
==
i
)
{
x
=
x
-
1
.
0
;
}
else
;
//违背1
if
(
0
==
j
)
{
x
=
x
+
1
.
0
;
}
else
if
(
1
==
j
)
{
;
//违背2
}
else
//违背3
{
}
if
(
0
==
k
)
{
x
=
x
/
2
.
0
;
}
else
if
(
1
==
k
)
{
x
=
x
/
3
.
0
;
}
else
{
/* no deal with */
//违背4
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-2/R-1-4-2-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
,
k
=
0
;
double
x
=
0.0
;
//..
if
(
0
==
i
)
{
x
=
1.0
;
}
else
if
(
1
==
i
)
{
x
=
x
-
1.0
;
}
else
;
//违背1
if
(
0
==
j
)
{
x
=
x
+
1.0
;
}
else
if
(
1
==
j
)
{
;
//违背2
}
else
//违背3
{
}
if
(
0
==
k
)
{
x
=
x
/
2.0
;
}
else
if
(
1
==
k
)
{
x
=
x
/
3.0
;
}
else
{
/* no deal with */
//违背4
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
,
k
=
0
;
double
x
=
0
.
0
;
//..
if
(
0
==
i
)
{
x
=
1
.
0
;
}
else
if
(
1
==
i
)
{
x
=
x
-
1
.
0
;
}
else
{
;
/* no deal with */
//遵循1
}
if
(
0
==
j
)
{
x
=
x
+
1
.
0
;
}
else
if
(
1
==
j
)
{
;
/* no deal with */
//遵循2
}
else
{
;
/* no deal with */
//遵循3
}
if
(
0
==
k
)
{
x
=
x
/
2
.
0
;
}
else
if
(
1
==
k
)
{
x
=
x
/
3
.
0
;
}
else
{
;
/* no deal with */
//遵循4
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-2/R-1-4-2-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
,
k
=
0
;
double
x
=
0.0
;
//..
if
(
0
==
i
)
{
x
=
1.0
;
}
else
if
(
1
==
i
)
{
x
=
x
-
1.0
;
}
else
{
;
/* no deal with */
//遵循1
}
if
(
0
==
j
)
{
x
=
x
+
1.0
;
}
else
if
(
1
==
j
)
{
;
/* no deal with */
//遵循2
}
else
{
;
/* no deal with */
//遵循3
}
if
(
0
==
k
)
{
x
=
x
/
2.0
;
}
else
if
(
1
==
k
)
{
x
=
x
/
3.0
;
}
else
{
;
/* no deal with */
//遵循4
}
return
(
0
);
}
BM-GJB8114-2013/R-1-4-3/R-1-4-3-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
;
switch
(
i
)
{
}
//违背1
return
(
0
);
}
Prev
1
…
10
11
12
13
14
15
16
17
18
…
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