Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- int const NMAX=100;
- int main(int argc, char** argv) {
- int c, nc, r, nr, mat[NMAX][NMAX];
- bool maggiore=false;
- cout<<"Inserire il numero delle righe: ";
- cin>>nr;
- cout<<"Inserire il numero delle colonne: ";
- cin>>nc;
- srand(time(NULL));
- for(r=0; r<nr; r++){
- cout<<"\n";
- for(c=0; c<nc; c++){
- mat[r][c]=(rand()%201)-100;
- printf("%5d", mat[r][c]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement