[error] a function-definition is not allowed here before '{' token
[error] expected '}' at and of input.
Kod: Zaznacz cały
#include <iostream>
#include <iomanip>
#include <ctime>
#include <stdio.h>
#include <math.h>
#include <fstream>
#include <stdlib.h>
#include <conio.h>
using namespace std;
#define C 0.000001
#define R 0.2
#define L 0.00000005
#define V 1000
int main (int argc, char* argv[])
{
double f(int x[], int y[])
{
int k[6];
int x[100];
int y[100]
int h=0.1;
y[0]=0;
x[0]=0;
for (int i=0; i<=100-1; i++)
{
x[i]=x[0]+i*h;
k[1]=h*f(x[i],y[i]);
k[2]=h*f(x[i]+(h/4),y[i]+(k[1]/4));
k[3]=h*f(x[i]+(3*h/8), y[i]+(3*k[1]/33)+(9*k[2]/32));
k[4]=h*f(x[i]+(12*h/13), y[i]+(1932*k[1]/2197)-(7200*k[2]/2197)+(7296*k[3]/2197));
k[5]=h*f(x[i]+h,y[i]+(439*(k[1]/216)-8*k[2]+(3680*k[3]/513)-(845*k[4]/4104));
k[6]=h*(x[i]+(h/2), y[i]-(8*k[1]/27)+2*k[2]-(3544*k[3]/2565)+(1859*k[4]/414)-(11*k[5]/40));
y[i+1]=y[i]+(25*k[1]/216)+(1408*k[3]/2565)+(2197*k[4]/414)-(k[5]/5);
ynext[i+1]=y[i]+(16*k[1]/135)+(6656*k[3]/12852)+(28561*k[4]/56430)-(9*k[5]/50)+(2*k[6]/55));
return ynext;
}}}
double rkf(int x[], int y[], int z[], int w[])
{
for (int i=0;i<=100-1;i++)
{
int y[100];
int x[100];
int z[100];
int w[100];
int h=0.1;
y[0]=0;
x[0]=0;
z[0]=0;
w[0]=0;
z[i]=(y[i]*(x[i]-x[0])-y[0])/h;
w[i]=(z[i]*(x[i]-x[0])-z[0])/h;
return (w[i]+(R/L)*z[i]+(y[i]/(L*C)));
}
ofstream os;
os.open("'out.dat'");
if(not os) cout<<"Unable to oen/write file 'out.dat'."<<endl;
}