Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include stdafx.h
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <time.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- setlocale(LC_CTYPE,"Russian");
- srand((unsigned)time(NULL));
- const int n=25;
- double x[n],y[n];
- double p=1;
- int A;
- cout << "Введите число A:";
- cin >> A;
- for(int i=0;i<n;i++) x[i]=rand()/100-100;
- cout<<"Массив X>";
- for(int i=0;i<n;i++)cout<<x[i]<<setw(10);
- cout<<endl;
- for(int i=0;i<n;i++) y[i]=rand()/100-100;
- cout<<"Массив Y>";
- for(int i=0;i<n;i++)cout<<y[i]<<setw(10);
- cout<<endl;
- for(int i=0;i<n;i++)
- if(abs(X[i] - Y[i]) > A) p *= abs(X[i] - Y[i]);
- cout<<"Произведение элементов массива Y = "<<p<<endl;
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement