Demande aide pour prog en c
celine
-
gilles -
gilles -
prog qui lit plusieurs fichiers et met les elements de ces fichiers soigneusement recuperes dans des tableaux dans un 3 eme tableau.y a t il erreurs.Gros merci d'avance
# define ligne 30000
# define colonne 30
# define colonneg 60
# include <stdio.h>
int connexion (int); /* prototype des fonctions */
void remplissage();
void remplissagetab();
main()
{
char textelu;
char tab1[ligne][colonne], tab2[ligne][colonne], tab3[ligne][colonneg];
int i, j, k, l, m, n;/* declaration des variables */
int x, a;
a=0;
x=1;
for (x=1;x<5;x++)
{
x=connexion (x);
do
{
remplissage();
a=a+1; /* compteur qui permet un remplissage net du tableau */
}while ((textelu=getchar())!= '/(0)');
}
for (j=0; j<ligne; j++)
{
for (i=0; i<colonne; i++)
{
for (l=0; l<ligne; l++)
{
for (k=0; k<colonne; k++)
{
if ((tab1[0][0]==tab2[0][0]) && tab1[0][2]==tab2[0][2] && (tab1[0][11]==tab2[0][5]))
{
for (n=0; n<ligne; n++)
{
for (m=0; m<colonne; m++)
{
tab3[n][m]=tab1[j][i];
for (m=m+1; m<colonneg; m++)
{
tab3[n][m]=tab2[l][k];
}
}
}
}
}
}
}
}
/* mise en place du tableau 3 dans un fichier */
for (n=0; n<ligne; n++)
{
for (m=0; m<colonne; m++)
{
tab3[n][m]= //Triv/C:/projet celine/testsubsrib.log;
}
}
return 0;
}
/* description des fonctions */
/* 1 fonction */
int connexion (int (x))
{
switch (x)
{
case 1: //Triv/C:/projet celine/essailocal/pbx001/subsrib.log
//Triv/C:/projet celine/essailocal/pbx001/grp.log
break;
case 2: //Triv/C:/projet celine/essailocal/pbx002/subsrib.log
//Triv/C:/projet celine/essailocal/pbx002/grp.log
break;
case 3: //Triv/C:/projet celine/essailocal/pbx003/subsrib.log
//Triv/C:/projet celine/essailocal/pbx003/grp.log
break;
case 4: //Triv/C:/projet celine/essailocal/pbx004/subsrib.log
//Triv/C:/projet celine/essailocal/pbx004/grp.log
break;
}
return (x);
}
/* 2 fonction */
void remplissage (void)
{
char mot, textelu;
char tab1[ligne][colonne];
int i, j,a;
a=0;
for ( j=a; j<ligne; j++)
{
do
{
for (i=0; i<colonne; i++)
{
while ((textelu=getchar()) != '\(59)')
{
mot = mot,textelu;
mot=getchar();
}
if ((mot=getchar()) != tab1[mot][j])
{
tab1 [j][i]=mot;
mot ='\(0)';
}
else
remplissagetab () ;
}
}while ((textelu=getchar()) != '\n');
}
return ;
}
/* 3 fonction */
void remplissagetab (void)
{
char mot, textelu;
char tab1[ligne][colonne];
int i, j, k, l;
for (l=0; l<ligne; l++)
{
do
{
for (k=0; k<colonne; k++)
{
do
{
mot = mot,textelu;
mot=getchar();
}while ((textelu=getchar()) != '\(59)');
tab1 [j][i]=mot;
mot ='\(0)';
}
}while ((textelu=getchar()) != '\n');
}
return ;
}
# define ligne 30000
# define colonne 30
# define colonneg 60
# include <stdio.h>
int connexion (int); /* prototype des fonctions */
void remplissage();
void remplissagetab();
main()
{
char textelu;
char tab1[ligne][colonne], tab2[ligne][colonne], tab3[ligne][colonneg];
int i, j, k, l, m, n;/* declaration des variables */
int x, a;
a=0;
x=1;
for (x=1;x<5;x++)
{
x=connexion (x);
do
{
remplissage();
a=a+1; /* compteur qui permet un remplissage net du tableau */
}while ((textelu=getchar())!= '/(0)');
}
for (j=0; j<ligne; j++)
{
for (i=0; i<colonne; i++)
{
for (l=0; l<ligne; l++)
{
for (k=0; k<colonne; k++)
{
if ((tab1[0][0]==tab2[0][0]) && tab1[0][2]==tab2[0][2] && (tab1[0][11]==tab2[0][5]))
{
for (n=0; n<ligne; n++)
{
for (m=0; m<colonne; m++)
{
tab3[n][m]=tab1[j][i];
for (m=m+1; m<colonneg; m++)
{
tab3[n][m]=tab2[l][k];
}
}
}
}
}
}
}
}
/* mise en place du tableau 3 dans un fichier */
for (n=0; n<ligne; n++)
{
for (m=0; m<colonne; m++)
{
tab3[n][m]= //Triv/C:/projet celine/testsubsrib.log;
}
}
return 0;
}
/* description des fonctions */
/* 1 fonction */
int connexion (int (x))
{
switch (x)
{
case 1: //Triv/C:/projet celine/essailocal/pbx001/subsrib.log
//Triv/C:/projet celine/essailocal/pbx001/grp.log
break;
case 2: //Triv/C:/projet celine/essailocal/pbx002/subsrib.log
//Triv/C:/projet celine/essailocal/pbx002/grp.log
break;
case 3: //Triv/C:/projet celine/essailocal/pbx003/subsrib.log
//Triv/C:/projet celine/essailocal/pbx003/grp.log
break;
case 4: //Triv/C:/projet celine/essailocal/pbx004/subsrib.log
//Triv/C:/projet celine/essailocal/pbx004/grp.log
break;
}
return (x);
}
/* 2 fonction */
void remplissage (void)
{
char mot, textelu;
char tab1[ligne][colonne];
int i, j,a;
a=0;
for ( j=a; j<ligne; j++)
{
do
{
for (i=0; i<colonne; i++)
{
while ((textelu=getchar()) != '\(59)')
{
mot = mot,textelu;
mot=getchar();
}
if ((mot=getchar()) != tab1[mot][j])
{
tab1 [j][i]=mot;
mot ='\(0)';
}
else
remplissagetab () ;
}
}while ((textelu=getchar()) != '\n');
}
return ;
}
/* 3 fonction */
void remplissagetab (void)
{
char mot, textelu;
char tab1[ligne][colonne];
int i, j, k, l;
for (l=0; l<ligne; l++)
{
do
{
for (k=0; k<colonne; k++)
{
do
{
mot = mot,textelu;
mot=getchar();
}while ((textelu=getchar()) != '\(59)');
tab1 [j][i]=mot;
mot ='\(0)';
}
}while ((textelu=getchar()) != '\n');
}
return ;
}
A voir également:
- Demande aide pour prog en c
- Robot prog - Télécharger - Édition & Programmation
- Clear prog - Télécharger - Sécurité
- Pb advpack.dll lors d'installation de prog - Forum Windows
- Recherche petit prog autre que paint ✓ - Forum Windows
- Décocher la case : toujours utiliser ce prog ✓ - Forum Windows
et effectivement, pourquoi tu ne testes pas ton programme, si nécessaire en lui faisant afficher des valeurs intermédiaires ?
Autre remarque pour terminer : la même chose en Perl prend 5 lignes ou quasiment...