exp (-x*x)

 1 #include <math.h>
 2 #include <stdio.h>
 3 double fx(int x){
 4     double result=exp (-x*x);
 5     return result;
 6 }
 7 
 8 int main(){
 9     int i;
10     for(i=-1;i<=2;i++){
11         printf("x=%d,y=%f\n",i,fx(i));
12     }
13     return 0;
14 }

 

posted @ 2018-11-29 21:42  f--  阅读(133)  评论(0编辑  收藏  举报