#include
#include
#include
#include
using namespace std;
void RandArr(double *mas, int d_min,int d_max,int n)
{
int m=d_max - d_min + 1;
for(int i=0; i {
mas[i]=rand()%m + d_min;
cout << mas[i]<<" ";<br> }
cout <<endl;<br> }
void f(double *xx, double *yy, int k, int n)
{
double t=0; for(int i=0; i {
for(int j=1; j<=k; ++j)<br> t+=cos(j*xx[i])/(j*j);
yy[i]=t;
t=0;
}
}
void PrintStar()
{ for(int i=0; i<80; ++i) cout <<"*"; cout << endl; }<br>
void ShowArr(double *mas,int n)
{
for(int i=0; i cout<< mas[i]<<" ";<br> cout <<endl;<br> PrintStar();
}
int main(int argc, char *argv[])
{
srand(time(0));
short const N1=20,N2=18,N3=12;
double x1[N1],x2[N2],x3[N3];
int D_MIN[3]={2,-5,7}, D_MAX[3]={10,2,10};
cout <<"X1: ";<br> RandArr(x1,D_MIN[0],D_MAX[0],N1);
cout <<"X2: ";<br> RandArr(x2,D_MIN[1],D_MAX[1],N2);
cout <<"X3: ";<br> RandArr(x3,D_MIN[2],D_MAX[2],N3);
double y1[N1],y2[N2],y3[N3];
f(x1,y1,4,N1);
f(x2,y2,4,N2);
f(x3,y3,4,N3);
cout <<"Y1: ";<br> ShowArr(y1,N1);
cout <<"Y2: ";<br> ShowArr(y2,N2);
cout <<"Y3: ";<br> ShowArr(y3,N3);
cin.get();
return EXIT_SUCCESS;
}