1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| double f(double x,double param){
if(x<0){return 0;}
if(x>1){return 0;}
if(x<0.5){return param;}
if(x>=0.5){return 1-param;}
}
double fonction2(double a1,double a2,double a3,double m,double x){
if(x<a1){return 0;}
if(x>a3){return 0;}
if(x<a2){return f(x,m)*m;}
if(x>=a2){return f(x,m)*(1-m);}
}
int main(){
double *g=new double[100];
fonction2 *tableau=new fonction2[100];
double (*p)(double,double,double,double,double);
p=&fonction2;
cout<<(*p)(2,3,4,2,4);
return 0;
} |
Partager