SHARE
TWEET

Untitled

a guest Apr 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "pch.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,min;
  8. cin>>n;
  9.     int **ma = new int*[n];
  10.     for (int i = 0; i < n; i++)
  11.         ma[i] = new int[n];
  12.     int *mas = new int[n];
  13.     for (int i = 0; i < n; i++)
  14.         for (int j = 0; j < n; j++)
  15.             ma[i][j] = rand()%10-5;
  16.     for (int i = 0; i < n; i++){
  17.         for (int j = 0; j < n; j++)
  18.         cout<<ma[i][j]<<"\t";
  19.         cout<<"\n";}
  20.     for (int i = 0; i < n; i++){
  21.     min=abs(ma[i][0]);
  22.         for (int j = 0; j < n; j++)
  23.         if(abs(ma[i][j])<abs(min))
  24.         min=abs(ma[i][j]);
  25.         mas[i]=min;}
  26.     for (int j = 0; j < n; j++)
  27.     cout<<mas[j];
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top