Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
controle-c-001
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
florian.burgener
controle-c-001
Commits
28de996c
Commit
28de996c
authored
3 years ago
by
Florian Burgener
Browse files
Options
Downloads
Patches
Plain Diff
Rename ex
parent
63dd851f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ex1/main.c
+19
-19
19 additions, 19 deletions
ex1/main.c
ex2/main.c
+19
-19
19 additions, 19 deletions
ex2/main.c
with
38 additions
and
38 deletions
ex1/main.c
+
19
−
19
View file @
28de996c
...
...
@@ -16,29 +16,29 @@
#include
<stdlib.h>
#include
<string.h>
bool
is_latin_square_normalized
(
int32_t
latin_square
[
4
][
4
])
{
for
(
int32_t
i
=
0
;
i
<
4
;
i
+=
1
)
{
if
(
latin_square
[
0
][
i
]
!=
i
+
1
||
latin_square
[
i
][
0
]
!=
i
+
1
)
{
return
false
;
}
}
int
main
()
{
// int32_t values_length = 5;
// double values[values_length];
return
true
;
}
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
int
main
()
{
int32_t
latin_square
[
4
][
4
];
// int32_t values_length = 5;
//
int32_t
values[values_length
];
for
(
int32_t
i
=
0
;
i
<
4
;
i
+=
1
)
{
for
(
int32_t
j
=
0
;
j
<
4
;
j
+=
1
)
{
int32_t
tmp
;
scanf
(
"%d"
,
&
tmp
);
latin_square
[
i
][
j
]
=
tmp
;
}
}
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
bool
is_normalized
=
is_latin_square_normalized
(
latin_square
);
printf
(
"latin normalisé: %s
\n
"
,
(
is_normalized
?
"oui"
:
"non"
));
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
return
EXIT_SUCCESS
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ex2/main.c
+
19
−
19
View file @
28de996c
...
...
@@ -16,29 +16,29 @@
#include
<stdlib.h>
#include
<string.h>
int
main
()
{
// int32_t values_length = 5;
// double values[values_length];
bool
is_latin_square_normalized
(
int32_t
latin_square
[
4
][
4
])
{
for
(
int32_t
i
=
0
;
i
<
4
;
i
+=
1
)
{
if
(
latin_square
[
0
][
i
]
!=
i
+
1
||
latin_square
[
i
][
0
]
!=
i
+
1
)
{
return
false
;
}
}
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
return
true
;
}
// int32_t values_length = 5;
//
int32_t
values[values_length
];
int
main
()
{
int32_t
latin_square
[
4
][
4
];
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
for
(
int32_t
i
=
0
;
i
<
4
;
i
+=
1
)
{
for
(
int32_t
j
=
0
;
j
<
4
;
j
+=
1
)
{
int32_t
tmp
;
scanf
(
"%d"
,
&
tmp
);
latin_square
[
i
][
j
]
=
tmp
;
}
}
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
bool
is_normalized
=
is_latin_square_normalized
(
latin_square
);
printf
(
"latin normalisé: %s
\n
"
,
(
is_normalized
?
"oui"
:
"non"
));
return
EXIT_SUCCESS
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment