| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 602 人关注过本帖, 1 人收藏
标题:本人对函数编程不是很熟悉,这个第一个尝试做的,希望会的朋友给我指正-我给 ...
只看楼主 加入收藏
梁朝斌
Rank: 4
等 级:业余侠客
帖 子:192
专家分:288
注 册:2012-10-21
结帖率:100%
收藏(1)
已结贴  问题点数:50 回复次数:10 
本人对函数编程不是很熟悉,这个第一个尝试做的,希望会的朋友给我指正-我给多点分
#include<stdio.h>
#include<math.h>
#define maxsize 100
void eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
     y[i+1]=y[i]+step*f1(x[i+1],y[i]);
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void modified_eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step,y[i]+k1);
        y[i+1]=y[i]+(k1+k2)/2;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void runge_kutta(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step/2,y[i]+k1/2);
        k3=step*f1(x[i]+step/2,y[i]+k2/2);
        k4=step*f1(x[i]+step,y[i]+k3);
        y[i+1]=y[i]+(k1+2*k2+2*k3+k4)/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void gill(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=f1(x[i],y[i]);
        k2=f1(x[i]+step/2,y[i]+k1*step/2);
        k3=f1(x[i]+step/2,y[i]+(sqrt(2)-1)*step*k1/2+(1-sqrt(2)/2)*step*k2);
        k4=f1(x[i]+step,y[i]-sqrt(2)*step*k2/2+(1+sqrt(2)/2)*step*k3);
        y[i+1]=y[i]+(k1+(2-sqrt(2))*k2+(2+sqrt(2))*k3+k4)*step/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void menu()
{
    printf("********************************\n");
    printf("请选择命令号!*******************\n");
    printf("1欧拉折线法求解微分!           *\n");
    printf("2欧拉改进法求解微分!           *\n");
    printf("3龙格-库塔公式求解微分!        *\n");
    printf("4-基尔公式求解微分!            *\n");
    printf("0退出!                         *\n");
    printf("********************************\n");
}
int main(void)
{
    int i,sel;
    double (double x[i],double y[i]);
    while(1)
    {
        menu();
        printf("请输入命令号:\n");
        scanf("%d",&sel);
        switch(sel)
        {
            case 1:eulerian_method(x[i],y[i]);
            case 2:modified_eulerian-method(x[i],y[i]);
            case 3: runge_kutta(x[i],y[i]);
            case 4:gill(x[i],y[i]);
            case 0:exit(1);break;
            default:
                 printf("输入的命令号错误!请重新输入:\n");
                 break;
        }
    }
    return 0;
}

double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}
搜索更多相关主题的帖子: double please include 
2012-12-15 16:16
神龙赖了
Rank: 10Rank: 10Rank: 10
来 自:萨塔星
等 级:青峰侠
威 望:2
帖 子:711
专家分:1788
注 册:2012-10-13
收藏
得分:25 
这里错误有点多,一下子可能改不过来,
先把程序要做的事情告诉我们吧

I have not failed completely
2012-12-15 19:37
梁朝斌
Rank: 4
等 级:业余侠客
帖 子:192
专家分:288
注 册:2012-10-21
收藏
得分:0 
欧拉公式求微分
#include<stdio.h>
#include<math.h>
#define maxsize 100
int main(void)
{
    double a,b,step,x[maxsize],y[maxsize];
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
        n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        y[i+1]=y[i]+step*f1(x[i+1],y[i]);
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
    return 0;
}
double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}
改进欧拉公式求微分#include<stdio.h>
#include<math.h>
#define maxsize 100
int main(void)
{
    double a,b,step,x[maxsize],y[maxsize],k1,k2;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
        n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step,y[i]+k1);
        y[i+1]=y[i]+(k1+k2)/2;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
    return 0;
}
double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}
龙格-库塔公式求微分
#include<stdio.h>
#include<math.h>
#define maxsize 100
int main(void)
{
    double a,b,step,x[maxsize],y[maxsize],k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
        n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step/2,y[i]+k1/2);
        k3=step*f1(x[i]+step/2,y[i]+k2/2);
        k4=step*f1(x[i]+step,y[i]+k3);
        y[i+1]=y[i]+(k1+2*k2+2*k3+k4)/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
    return 0;
}
double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}
基尔公式求微分
#include<stdio.h>
#include<math.h>
#define maxsize 100
int main(void)
{
    double a,b,step,x[maxsize],y[maxsize],k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
        n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=f1(x[i],y[i]);
        k2=f1(x[i]+step/2,y[i]+k1*step/2);
        k3=f1(x[i]+step/2,y[i]+(sqrt(2)-1)*step*k1/2+(1-sqrt(2)/2)*step*k2);
        k4=f1(x[i]+step,y[i]-sqrt(2)*step*k2/2+(1+sqrt(2)/2)*step*k3);
        y[i+1]=y[i]+(k1+(2-sqrt(2))*k2+(2+sqrt(2))*k3+k4)*step/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
    return 0;
}
double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}
我想把这几种方法和在一起,就是这个意思,以上单独求微分的方法都完全正确,我现在需要做的,就是想合起来
#include<stdio.h>
#include<math.h>
#define maxsize 100
void eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
     y[i+1]=y[i]+step*f1(x[i+1],y[i]);
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void modified_eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step,y[i]+k1);
        y[i+1]=y[i]+(k1+k2)/2;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void runge_kutta(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step/2,y[i]+k1/2);
        k3=step*f1(x[i]+step/2,y[i]+k2/2);
        k4=step*f1(x[i]+step,y[i]+k3);
        y[i+1]=y[i]+(k1+2*k2+2*k3+k4)/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void gill(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=f1(x[i],y[i]);
        k2=f1(x[i]+step/2,y[i]+k1*step/2);
        k3=f1(x[i]+step/2,y[i]+(sqrt(2)-1)*step*k1/2+(1-sqrt(2)/2)*step*k2);
        k4=f1(x[i]+step,y[i]-sqrt(2)*step*k2/2+(1+sqrt(2)/2)*step*k3);
        y[i+1]=y[i]+(k1+(2-sqrt(2))*k2+(2+sqrt(2))*k3+k4)*step/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void menu()
{
    printf("********************************\n");
    printf("请选择命令号!*******************\n");
    printf("1欧拉折线法求解微分!           *\n");
    printf("2欧拉改进法求解微分!           *\n");
    printf("3龙格-库塔公式求解微分!        *\n");
    printf("4-基尔公式求解微分!            *\n");
    printf("0退出!                         *\n");
    printf("********************************\n");
}
int main(void)
{
    int i,sel;
    double (double x[i],double y[i]);
    while(1)
    {
        menu();
        printf("请输入命令号:\n");
        scanf("%d",&sel);
        switch(sel)
        {
            case 1:eulerian_method(x[i],y[i]);
            case 2:modified_eulerian-method(x[i],y[i]);
            case 3: runge_kutta(x[i],y[i]);
            case 4:gill(x[i],y[i]);
            case 0:exit(1);break;
            default:
                 printf("输入的命令号错误!请重新输入:\n");
                 break;
        }
    }
    return 0;
}

double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}


菜鸟也疯狂
2012-12-15 20:04
梁朝斌
Rank: 4
等 级:业余侠客
帖 子:192
专家分:288
注 册:2012-10-21
收藏
得分:0 
二楼,麻烦你说说,我就是不太懂才放上来问的,单独的公式求解我已经写得完全正确啦

菜鸟也疯狂
2012-12-15 20:05
神龙赖了
Rank: 10Rank: 10Rank: 10
来 自:萨塔星
等 级:青峰侠
威 望:2
帖 子:711
专家分:1788
注 册:2012-10-13
收藏
得分:0 
double (double x[i],double y[i]);
这里传递不能为i,因为i是变量,这里规定的是传入的数组的大小,因为是一维数组,所以可以写作double x[],double y[])不用指定大小,但二维数组不行
程序代码:
int i,sel;
    double (double x[i],double y[i]);  //应规定函数名
    while(1)
    {
        menu();
        printf("请输入命令号:\n");
        scanf("%d",&sel);
        switch(sel)
        {
            case 1:eulerian_method(x[i],y[i]);  //没有关于x和y的声明,i的值也未初始化,无法编译
程序代码:
            case 2:modified_eulerian-method(x[i],y[i]);  //在main函数中找不到关于这个的声明,无法编译
            case 3: runge_kutta(x[i],y[i]);              //同上
            case 4:gill(x[i],y[i]);                      //同上
            case 0:exit(1);break;                        //我记得应在每个case的最后都跟一个break;不然default会输出
            default:
                 printf("输入的命令号错误!请重新输入:\n");
                 break;
        }
    }

可能还有点错误,不过都是格式错误而已,改改就行了,
建议把函数声明为全局变量,清晰且适用

I have not failed completely
2012-12-15 21:02
梁朝斌
Rank: 4
等 级:业余侠客
帖 子:192
专家分:288
注 册:2012-10-21
收藏
得分:0 
楼主大哥,你标注的我不是很明白,你能不能帮我直接改改你标注的错误啊,其实我还是不懂的怎么修改,因为没做过多少次这样的

菜鸟也疯狂
2012-12-15 21:14
神龙赖了
Rank: 10Rank: 10Rank: 10
来 自:萨塔星
等 级:青峰侠
威 望:2
帖 子:711
专家分:1788
注 册:2012-10-13
收藏
得分:0 
代码不是我编的,我也不知道能不能改对哦...试试吧

I have not failed completely
2012-12-15 22:32
神龙赖了
Rank: 10Rank: 10Rank: 10
来 自:萨塔星
等 级:青峰侠
威 望:2
帖 子:711
专家分:1788
注 册:2012-10-13
收藏
得分:0 
程序代码:
#include<stdio.h>
#include<math.h>
#define maxsize 100


 double f1(double x,double y);

 double f2(double x);


void eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);
    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
     y[i+1]=y[i]+step*f1(x[i+1],y[i]);
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void modified_eulerian_method(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
        k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step,y[i]+k1);
        y[i+1]=y[i]+(k1+k2)/2;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void runge_kutta(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=step*f1(x[i],y[i]);
        k2=step*f1(x[i]+step/2,y[i]+k1/2);
        k3=step*f1(x[i]+step/2,y[i]+k2/2);
        k4=step*f1(x[i]+step,y[i]+k3);
        y[i+1]=y[i]+(k1+2*k2+2*k3+k4)/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void gill(double x[maxsize],double y[maxsize])
{
    double a,b,step,k1,k2,k3,k4;
    double f1(double x,double y);
    double f2(double x);
    int i,n;
    printf("please input step=\n");
    scanf("%lf",&step);
    printf("please input a= and b=\n");
    scanf("%lf %lf",&a,&b);

    n=(int)((b-a)/step);
    for(i=0;i<=n;i++)
        x[i]=a+i*step;
    y[0]=0;
    for(i=0;i<=n-1;i++)
    {
           k1=f1(x[i],y[i]);
        k2=f1(x[i]+step/2,y[i]+k1*step/2);
        k3=f1(x[i]+step/2,y[i]+(sqrt(2)-1)*step*k1/2+(1-sqrt(2)/2)*step*k2);
        k4=f1(x[i]+step,y[i]-sqrt(2)*step*k2/2+(1+sqrt(2)/2)*step*k3);
        y[i+1]=y[i]+(k1+(2-sqrt(2))*k2+(2+sqrt(2))*k3+k4)*step/6;
    }
    for(i=0;i<=n;i++)
    {
        printf("x[%d]=%lf,y[%d]=%lf,f2=%lf",i,x[i],i,y[i],f2(x[i]));
        printf("\n");
    }
}
void menu()
{
    printf("********************************\n");
    printf("请选择命令号!*******************\n");
    printf("1欧拉折线法求解微分!           *\n");
    printf("2欧拉改进法求解微分!           *\n");
    printf("3龙格-库塔公式求解微分!        *\n");
    printf("4-基尔公式求解微分!            *\n");
    printf("0退出!                         *\n");
    printf("********************************\n");
}
int main(void)
{
    int sel = 0;
    double x[maxsize];
    double y[maxsize];
    while(sel != 0)
    {
        menu();
        printf("请输入命令号:\n");
        scanf("%d",&sel);
        switch(sel)
        {
            case 1:
            eulerian_method(x, y);
            break;

            case 2:
            modified_eulerian_method(x, y);
            break;

            case 3:
            runge_kutta(x, y);
            break;

            case 4:
            gill(x, y);
            break;

            case 0:
            break;
           
            default:
                 printf("输入的命令号错误!请重新输入:\n");
                 break;
        }
    }
    return 0;
}

double f1(double x,double y)
{
    double z;
    z=622*sin(314*x)-20*y;
    return z;
}
double f2(double x)
{
    double z;
    z=48827*(exp(-20*x)+10*sin(314*x)/157-cos(314*x))/24749;
    return z;
}


能够编译了,对不对就不知道了,毕竟是你亲手编写的嘛...
图片附件: 游客没有浏览图片的权限,请 登录注册

I have not failed completely
2012-12-15 22:50
梁朝斌
Rank: 4
等 级:业余侠客
帖 子:192
专家分:288
注 册:2012-10-21
收藏
得分:0 
谢谢,谢谢,太感谢,我一定会好好看看,我把分全给你

菜鸟也疯狂
2012-12-15 23:45
神龙赖了
Rank: 10Rank: 10Rank: 10
来 自:萨塔星
等 级:青峰侠
威 望:2
帖 子:711
专家分:1788
注 册:2012-10-13
收藏
得分:0 
没事,其实我也没有做太多,只是把main函数改了一下而已,其他那些真正伤脑细胞的源代码还是在楼主编写的那些个复杂函数里

I have not failed completely
2012-12-15 23:59
快速回复:本人对函数编程不是很熟悉,这个第一个尝试做的,希望会的朋友给我指正 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.077609 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved