16 if ((fp = fopen(filename,
"r")) == NULL) {
17 perror(
"Error loading file");
27 while((c = fgetc(fp)) !=
'\n');
28 }
while((c = fgetc(fp)) ==
'#');
34 fscanf(fp,
"%d %d\n", &nx, &ny);
39 printf(
"Input image : x=%d y=%d grey=%d\n", nx, ny, i);
42 for(i = 0;i <
SIZE; i++)
43 for(j = 0;j <
SIZE; j++) {
57 if ((fp = fopen(filename,
"w")) == NULL) {
58 perror(
"Error opening file");
65 for(i = 0;i <
SIZE; i++)
66 for(j = 0;j <
SIZE; j++) {
80 for(i = 1;i <
SIZE - 1; i++)
81 for(j = 1;j <
SIZE - 1; j++) {
85 for(i = 1;i <
SIZE - 1; i++)
86 for(j = 1;j <
SIZE - 1; j++) {
93 int main(
int argc,
char *argv[]) {
98 "%s needs only one argument that is the PGM image input file\n",
104 for(t = 0; t <
T; t++)
int main(int argc, char *argv[])
void get_data(char filename[])
float_t space[SIZE][SIZE]
void write_data(char filename[])
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...