C/C++の宿題を片付けます 82代目

このエントリーをはてなブックマークに追加
947デフォルトの名無しさん
[1] 授業単元:数値計算法
[2] 問題文(含コード&リンク):以下の常微分方程式をホイン法で解くためのプログラムを作成しなさい。また
0<=t<=10におけるx(t)およびy(t)のグラフをエクセルで作成しなさい。
dx/dt=2x(t)-0.01x(t)y(t)
dy/dt=-y(t)+0.01x(t)y(t)
[3] 環境
 [3.1] OS: Windows
 [3.2] コンパイラ名とバージョン: (gcc 3.4 VC 6.0等)
 [3.3] 言語:c言語
[4] 期限:2007年2月9日まで
#include <stdio.h>
double func(double x, double y);
void heun(double x, double y, double a,double b, int n,double (*f)(double,double));
int main(void)
{ int n;
print("分割数を入力してください--->")
scanf("%d",&n);
heun(0.0,1.0,0.0,1.0,n ,func);
return 0;}
void heun(double x, double y, double a, double b, int n, double (*f)(double,double))
{ double k1,k2,h;
int i;
h = (b-x)/n;
for (i = 0 ; i<n ; i++)
{ k1=f(x,y); k2 = f(x+h,y+h*k1);
y = y+h/2.0 * (k1 +k2);
x = x+h;
print("x=%f \t y=%f \n" , x,y);}}
ここからどういじるのでしょうか?