This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Slides de cours - Partie 4 Exercice de fin | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#define between(min, n, max) ((n) >= (min) && (n) <= (max)) | |
#define MAX_ARTICLES 100 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
titou@macbook-titou:~/Documents/ULg 2011-2012/INFO2009/projet/code[20:27:20]$ ./quicktest.sh | |
Version a 13 champs | |
gcc --std=c99 --pedantic -Wall -W -Wmissing-prototypes -o test -DBIO_T_TAILLE=13 main.c stats.c | |
252 mesures | |
Moyenne d'age: 44.884921 | |
Coefficient de variation de l'age: 0.280206 | |
Frequence relative de 42 ans: 0.047619 | |
Frequence relative cumulee de l'age: 1.000000 | |
Moyenne | 44.88 | 178.92 | 70.15 | 37.99 | 100.82 | 92.56 | 99.90 | 59.41 | 38.59 | 23.10 | 32.27 | 28.66 | 18.23 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = gcc | |
TARGET = info2009-projet1.exe | |
FILES = ui.c stats.c | |
OPTIONS = --std=c99 --pedantic -Wall -W -Wmissing-prototypes -O3 | |
LIBS = -lm | |
all : ${TARGET} | |
${TARGET} : ${FILES} | |
${CC} ${OPTIONS} ${LIBS} -o ${TARGET} -DBIO_T_TAILLE=13 ${FILES} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int **triangle_pascal(int n); | |
int main(int argc, const char **argv){ | |
int n = (argc > 1) ? atoi(argv[1]) : 10; | |
int **triangle = triangle_pascal(n); | |
int x, y; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Problème: le caractère de retour a la ligne, ainsi que chaque caractere supplémentaire sur la ligne, | |
* provoque un tour de boucle inutile | |
*/ | |
while (1) { | |
printf(" > "); | |
scanf("%c", &choix); | |
switch (choix){ | |
case '1': return MOYENNE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Si vous avez un Mac, copiez tout ce code à partir de "require 'net/http'" (en gardant une ligne vide à la fin), | |
ouvrez l'application terminal (Applications > Utilitaires > Terminal), et tapez la commande suivante: | |
cat | ruby | |
collez le code, et ensuite tapez CTRL+D | |
Vous permettrez aux restos du coeur d'avoir leurs 40 tonnes de légumes plus facilement | |
=end | |
require 'net/http' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bande_gauche = [['Verte', 150, 2, 1], ['Verte', 50, 1, -1], ['Jaune', 50, 1, -1], ['Jaune', 50, 0, 2]] | |
bande_milieu = [['Verte', 50, 4, 3], ['Mauve', 50, 2, 2]] | |
bande_droite = [['Jaune', 100, 6, 2], ['Verte', 50, 3, 2], ['Jaune', 100, 2, 1], ['Jaune', 100, 1, 1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bande_de_gauche = [['Verte', 150, 4, -1], ['Mauve', 50, 4, -1], ['Jaune', 50, 5, 1], ['Verte', 50, 0, 2]] | |
bande_du_milieu = [['Jaune', 50, 7, 3], ['Mauve', 50, 2, 2]] | |
bande_de_droite = [['Mauve', 150, 1, 1], ['Verte', 50, 3, 2], ['Verte', 150, 2, 1], ['Jaune', 50, 6, 1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 => 2 => 0 OK | |
1 => 73 => 1 OK | |
2 => 77 => 2 OK | |
3 => 72 => 3 OK | |
4 => 84 => 4 OK | |
5 => 62 => 5 OK | |
6 => 65 => 6 OK | |
7 => 35 => 7 OK | |
8 => 30 => 8 OK | |
9 => 1 => 9 OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Etat de la matrice S | |
#Avant encodage | |
N0 = [[76, 79, 82, 69, 77, 35, 73, 80, 83, 85, 77, 35, 68, 79, 76, 79, 82, 35, 83, 73], [84, 35, 65, 77, 69, 84, 44, 35, 67, 79, 78, 83, 69, 67, 84, 69, 84, 65, 85, 82], [35, 65, 68, 73, 80, 73, 83, 73, 67, 73, 78, 71, 35, 69, 76, 73, 84, 44, 35, 83], [69, 68, 35, 68, 79, 35, 69, 73, 85, 83, 77, 79, 68, 35, 84, 69, 77, 80, 79, 82], [35, 73, 78, 67, 73, 68, 73, 68, 85, 78, 84, 35, 85, 84, 35, 76, 65, 66, 79, 82], [69, 35, 69, 84, 35, 68, 79, 76, 79, 82, 69, 35, 77, 65, 71, 78, 65, 35, 65, 76], [73, 81, 85, 65, 46, 35, 85, 84, 35, 69, 78, 73, 77, 35, 65, 68, 35, 77, 73, 78], [73, 77, 35, 86, 69, 78, 73, 65, 77, 44, 35, 81, 85, 73, 83, 35, 78, 79, 83, 84], [82, 85, 68, 35, 69, 88, 69, 82, 67, 73, 84, 65, 84, 73, 79, 78, 35, 85, 76, 76], [65, 77, 67, 79, 35, 76, 65, 66, 79, 82, 73, 83, 35, 78, 73, 83, 73, 35, 85, 84], [35, 65, 76, 73, 81, 85, 73, 80, 35, 69, 88, 35, 69, 65, 35, 67, 79, 77, 77, 79], [68, 79, 35, 67, 79, 78, 83, 69, 81, 85, 65, 84, 46, 35, 68, 85, 73, 83, 35, |
OlderNewer