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 45 46 47
|
#include <stdio.h>
void attribuer_coefficient(int spe, float* coef)
{
switch(spe)
{
case 1 : coef[0]=9; coef[1]=6; coef[2]=6;break;
case 2 : coef[0]=7; coef[1]=8; coef[2]=6;break;
case 3 : coef[0]=7; coef[1]=6; coef[2]=8;break;
default : break;
}
coef[3]=3;
coef[4]=3;
coef[5]=3;
coef[6]=3;
coef[7]=2;
printf("\n\n%f\n",coef[0]);
printf("%f\n",coef[1]);
printf("%f\n",coef[2]);
printf("%f\n",coef[3]);
printf("%f\n",coef[4]);
printf("%f\n",coef[5]);
printf("%f\n",coef[6]);
printf("%f\n",coef[7]);
}
int main(void)
{
float coef[8];
int spe=1;
attribuer_coefficient(spe,coef);
printf("\n\n%f\n",coef[0]);
printf("%f\n",coef[1]);
printf("%f\n",coef[2]);
printf("%f\n",coef[3]);
printf("%f\n",coef[4]);
printf("%f\n",coef[5]);
printf("%f\n",coef[6]);
printf("%f\n",coef[7]);
return 0;
} |