1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
int resulta()
{
FILE *siren;
FILE *result;
char temp[200], Qvrep_d[15], Qvtrav_d[15], Qvrep[15], Qvtrav[15];
char ppm_Hall[15],ppm_Sejour[15],ppm_CH01[15],ppm_CH02[15],ppm_CH03[15],ppm_Cuisine[15],ppm_PT02[15],ppm_PT03[15];
int i;
siren=fopen("siren.txt","r");
result=fopen("result.dat","a");
fscanf(siren," %s %s %s %s %s", temp, temp, temp, temp, Qvrep_d);
fgets(temp,sizeof temp, siren);
fscanf(siren,"%s %s %s %s %s", temp, temp, temp, temp, Qvtrav_d);
fgets(temp, sizeof temp, siren);
fscanf(siren,"%s %s %s %s", temp, temp, temp, Qvrep);
fgets(temp, sizeof temp, siren);
fscanf(siren,"%s %s %s %s", temp, temp, temp, Qvtrav);
fwrite(&Qvrep_d,sizeof Qvrep_d,1,result);
fwrite(&Qvtrav_d,sizeof Qvtrav_d,1,result);
fwrite(&Qvrep,sizeof Qvrep,1,result);
fwrite(&Qvtrav,sizeof Qvtrav,1,result);
i=0;
for (i=1;i<38;i++)
{fgets(temp,sizeof temp,siren);}
fscanf(siren," %s %s %s %s %s %s %s %s",ppm_Hall,ppm_Sejour,ppm_CH01,ppm_CH02,ppm_CH03,ppm_Cuisine,ppm_PT02,ppm_PT03);
fwrite(&ppm_Hall,sizeof ppm_Hall,1,result);
fwrite(&ppm_Sejour,sizeof ppm_Sejour,1,result);
fwrite(&ppm_CH01,sizeof ppm_CH01,1,result);
fwrite(&ppm_CH02,sizeof ppm_CH02,1,result);
fwrite(&ppm_CH03,sizeof ppm_CH03,1,result);
fwrite(&ppm_Cuisine,sizeof ppm_Cuisine,1,result);
fwrite(&ppm_PT02,sizeof ppm_PT02,1,result);
fwrite(&ppm_PT03,sizeof ppm_PT03,1,result);
fprintf(result,"\n");
fclose(siren);
} |
Partager