#include <cstdlib>#include <iostream>#include <ctime>#include <math.h>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<n; ++i) { mas[i]=rand()%m + d_min; cout << mas[i]<<" "; } cout <<endl; }void f(double *xx, double *yy, int k, int n){ double t=0; for(int i=0; i<n; ++i) { for(int j=1; j<=k; ++j) t+=cos(j*xx[i])/(j*j); yy[i]=t; t=0; }}void PrintStar(){ for(int i=0; i<80; ++i) cout <<"*"; cout << endl; }void ShowArr(double *mas,int n){ for(int i=0; i<n; ++i) cout<< mas[i]<<" "; cout <<endl; 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: "; RandArr(x1,D_MIN[0],D_MAX[0],N1); cout <<"X2: "; RandArr(x2,D_MIN[1],D_MAX[1],N2); cout <<"X3: "; 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: "; ShowArr(y1,N1); cout <<"Y2: "; ShowArr(y2,N2); cout <<"Y3: "; ShowArr(y3,N3); cin.get(); return EXIT_SUCCESS;}