Skip to content
Snippets Groups Projects
Commit f8241ffe authored by Florian Burgener's avatar Florian Burgener
Browse files

Ex 1

parent 5a8cebbb
Branches
No related tags found
No related merge requests found
ex1/main 0 → 100755
File added
......@@ -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
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment