Skip to content

Instantly share code, notes, and snippets.

@zoranf
Created July 22, 2013 17:28
Show Gist options
  • Save zoranf/6055801 to your computer and use it in GitHub Desktop.
Save zoranf/6055801 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void izpisPolja(int polje[][10], int N) {
for (int a = 0; a < N; a++) {
for (int b = 0; b < N; b++) {
cout << polje[a][b] << " ";
}
cout << endl;
}
}
void main() {
srand (time(NULL));
const int N = 10;
int polje[N][N];
// Fill array
for (int a = 0; a < N; a++) {
for (int b = 0; b < N; b++) {
polje[a][b] = rand() % 9 + 1;
cout << polje[a][b] << " ";
}
cout << endl;
}
// Ponovni izpis
cout << "\nPonovni izpis\n\n";
izpisPolja(polje, N);
cin.get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment