Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Kayoung
/
experiment
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Kayoung
2021-09-28 15:24:29 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
413c8c713ee8ebe94e21ac801de59104ef25bed6
413c8c71
1 parent
d5e68d2e
Modify PrintProgram
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
PrintProgram.cpp
PrintProgram.cpp
View file @
413c8c7
...
...
@@ -2,10 +2,10 @@
#include <iomanip>
using
namespace
std
;
void
printMatrix
(
int
(
*
inMatrix
)[
4
])
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
cout
<<
left
<<
setfill
(
' '
)
<<
setw
(
5
)
<<
inMatrix
[
i
][
j
];
void
printMatrix
(
int
(
*
inMatrix
)[
5
])
{
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
for
(
int
j
=
0
;
j
<
5
;
j
++
)
{
cout
<<
left
<<
setfill
(
' '
)
<<
setw
(
8
)
<<
inMatrix
[
i
][
j
];
}
cout
<<
endl
;
}
...
...
@@ -13,12 +13,12 @@ void printMatrix(int(*inMatrix)[4]) {
int
main
()
{
srand
((
unsigned
int
)
time
(
NULL
));
int
matrix1
[
4
][
4
];
int
matrix2
[
4
][
4
];
int
sum
[
4
][
4
];
int
mul
[
4
][
4
];
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
int
matrix1
[
5
][
5
];
int
matrix2
[
5
][
5
];
int
sum
[
5
][
5
];
int
mul
[
5
][
5
];
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
for
(
int
j
=
0
;
j
<
5
;
j
++
)
{
matrix1
[
i
][
j
]
=
rand
()
%
101
;
matrix2
[
i
][
j
]
=
rand
()
%
101
;
sum
[
i
][
j
]
=
matrix1
[
i
][
j
]
+
matrix2
[
i
][
j
];
...
...
Please
register
or
login
to post a comment