Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int const NMAX=100;
  8. int main(int argc, char** argv) {
  9.     int c, nc, r, nr, mat[NMAX][NMAX];
  10.     bool maggiore=false;
  11.     cout<<"Inserire il numero delle righe: ";
  12.     cin>>nr;
  13.     cout<<"Inserire il numero delle colonne: ";
  14.     cin>>nc;
  15.     srand(time(NULL));
  16.     for(r=0; r<nr; r++){
  17.         cout<<"\n";
  18.         for(c=0; c<nc; c++){
  19.             mat[r][c]=(rand()%201)-100;
  20.                     printf("%5d", mat[r][c]);
  21.         }
  22.  
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement