#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main() {
srand(time(NULL));
int numOfSalesman = 5;
int numOfItems = 10;
int** salesmansArray = new int*[numOfSalesman];
for(int i = 0; i < numOfSalesman; i++) {
salesmansArray[i] = new int[numOfItems];
}
for(int i = 0; i < numOfSalesman; i++) {
for(int j = 0; j < numOfItems; j++) {
salesmansArray[i][j] = rand() % 20;
}
}
for(int i = 0; i < numOfSalesman; i++) {
cout << "salesman " << i << ": ";
for(int j = 0; j < numOfItems; j++) {
cout << salesmansArray[i][j] << " ";
}
cout << endl;
}
return 0;
}
Comments