Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int random(int a,int b);
- int main(){
- int dcp, min, max, b ;
- cout<<"Введите размер массива строк: ";
- cin>>dcp;
- cout<<"Введите размер массива столбцов: ";
- cin>>b;
- cout<<"Введите min диапозона: ";
- cin>>min;
- cout<<"Введите max диапозона: ";
- cin>>max;
- // b = dcp;
- double** mas = new double* [dcp];
- double* minElemnt = new double [dcp];
- double* maxElemnt = new double [dcp];
- for (int i = 0; i < b; i++) {
- minElemnt[i] = max + 1;
- maxElemnt[i] = min - 1;
- }
- for (int i = 0; i < dcp; i++)
- {
- mas[i] = new double[b];
- }
- for (int i = 0; i < dcp; i++)
- {
- for (int j = 0; j < b; j++)
- {
- /*if (min > 0)*/
- mas[i][j]=min + rand() % (max - min);
- //else mas[i][j]=min + rand() % (abs(min) + max);
- cout<<setw(3);
- cout<<setprecision(6)<<mas[i][j]<<" ";
- if (mas[i][j] < minElemnt[j]) {
- minElemnt[j] = mas[i][j];
- }
- if(mas[i][j] > maxElemnt[j]) {
- maxElemnt[j] = mas[i][j];
- }
- }
- cout<<endl;
- }
- for (int i = 0; i < b; i++) {
- cout << setw(3) << minElemnt[i] + maxElemnt[i] << " ";
- }
- cout<<endl;
- for (int i = 0; i < b; i++) {
- cout << setw(3) << minElemnt[i]<< " ";
- }
- cout<<endl;
- for (int i = 0; i < b; i++) {
- cout << setw(3) << maxElemnt[i] << " ";
- }
- cout<<endl;
- double pi = 3.1415926536;
- std::cout << std::setprecision(2) << std::fixed << pi << std::endl;
- std::cout << std::setprecision(2) << std::scientific << pi << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement