Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <ctime>
#include <time.h>
#define INTEGER
//#define DECIMAL //you'll have to change the type of an array from int to float
using namespace std;
#ifdef INTEGER
void FillMatrix(int **matrix, const int size){
for (int i=0; i<size; i++){
#include <iostream>
using namespace std;
void FillMatrix(double **matrix, const int size){
for (int i=0; i<size; i++){
for (int j=0; j<size; j++){
matrix[i][j] = rand()%30;
}
}
}
#include <iostream>
#include <cmath>
using namespace std;
void FillMatrix(double **matrix, const int size){
for (int i=0; i<size; i++){
for (int j=0; j<size; j++){
cout << "a[" << i+1 << "][" << j+1 << "] = ";
cin >> matrix[i][j];
}