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
195 additions
and
0 deletions
+195
-0
BM-GJB8114-2013/R-1-6-1/R-1-6-1-bad.cpp
BM-GJB8114-2013/R-1-6-1/R-1-6-1-bad.cpp
+8
-0
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.c
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.c
+8
-0
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.cpp
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.cpp
+8
-0
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.c
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.c
+11
-0
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.cpp
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.cpp
+11
-0
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.c
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.c
+11
-0
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.cpp
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.cpp
+11
-0
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.c
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.c
+9
-0
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.cpp
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.cpp
+9
-0
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.c
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.c
+8
-0
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.cpp
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.cpp
+8
-0
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.c
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.c
+11
-0
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.cpp
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.cpp
+11
-0
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.c
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.c
+9
-0
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.cpp
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.cpp
+9
-0
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.c
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.c
+10
-0
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.cpp
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.cpp
+10
-0
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.c
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.c
+11
-0
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.cpp
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.cpp
+11
-0
BM-GJB8114-2013/R-1-6-14/R-1-6-14-good.c
BM-GJB8114-2013/R-1-6-14/R-1-6-14-good.c
+11
-0
No files found.
BM-GJB8114-2013/R-1-6-1/R-1-6-1-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
idata
=
2.5
;
//违背1
idata
=
idata
+
1
;
return
(
0
);
}
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
idata
=
3
;
//遵循1
idata
=
idata
+
1
;
return
(
0
);
}
BM-GJB8114-2013/R-1-6-1/R-1-6-1-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
idata
=
3
;
//遵循1
idata
=
idata
+
1
;
return
(
0
);
}
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
if
(
i
==
!
1
)
//违背1
{
j
=
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-6-10/R-1-6-10-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
if
(
i
==
!
1
)
//违背1
{
j
=
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
if
(
i
!=
1
)
//遵循1
{
j
=
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-6-10/R-1-6-10-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
i
=
0
,
j
=
0
;
if
(
i
!=
1
)
//遵循1
{
j
=
1
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Edata
{
Enum1
=
0
,
Enum2
,
Enum3
};
unsigned
int
data
;
data
=
Enum2
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-11/R-1-6-11-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Edata
{
Enum1
=
0
,
Enum2
,
Enum3
};
unsigned
int
data
;
data
=
Enum2
;
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Edata
{
Enum1
=
0
,
Enum2
,
Enum3
}
data
;
data
=
Enum2
;
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-11/R-1-6-11-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
enum
Edata
{
Enum1
=
0
,
Enum2
,
Enum3
}
data
;
data
=
Enum2
;
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
a
=
5
;
int
b
=
0
;
int
c
,
d
;
c
=
a
/
b
;
//违背1
d
=
a
%
b
;
//违背2
return
(
0
);
}
BM-GJB8114-2013/R-1-6-12/R-1-6-12-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
a
=
5
;
int
b
=
0
;
int
c
,
d
;
c
=
a
/
b
;
//违背1
d
=
a
%
b
;
//违背2
return
(
0
);
}
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
x
=
1
,
y
=
2
;
int
ilen
;
ilen
=
sizeof
(
x
=
y
);
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-13/R-1-6-13-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
x
=
1
,
y
=
2
;
int
ilen
;
ilen
=
sizeof
(
x
=
y
);
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
x
=
1
,
y
=
2
;
int
ilen
;
x
=
y
;
ilen
=
sizeof
(
x
);
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-13/R-1-6-13-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
int
x
=
1
,
y
=
2
;
int
ilen
;
x
=
y
;
ilen
=
sizeof
(
x
);
//遵循1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.c
0 → 100644
View file @
2a291a73
#include <string.h>
int
main
(
void
)
{
int
src
[
2
]
=
{
1
,
2
};
int
des
[
4
]
=
{
0
,
0
,
0
,
0
};
memcpy
(
des
,
src
,
sizeof
(
des
)
);
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-14/R-1-6-14-bad.cpp
0 → 100644
View file @
2a291a73
#include <string.h>
int
main
(
void
)
{
int
src
[
2
]
=
{
1
,
2
};
int
des
[
4
]
=
{
0
,
0
,
0
,
0
};
memcpy
(
des
,
src
,
sizeof
(
des
)
);
//违背1
return
(
0
);
}
BM-GJB8114-2013/R-1-6-14/R-1-6-14-good.c
0 → 100644
View file @
2a291a73
#include <string.h>
int
main
(
void
)
{
int
src
[
2
]
=
{
1
,
2
};
int
des
[
4
]
=
{
0
,
0
,
0
,
0
};
memcpy
(
des
,
src
,
sizeof
(
src
)
);
//遵循1
return
(
0
);
}
Prev
1
…
12
13
14
15
16
17
18
19
20
…
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